Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Improve logging #33

Closed
Radiergummi opened this issue Jan 12, 2018 · 2 comments
Closed

Improve logging #33

Radiergummi opened this issue Jan 12, 2018 · 2 comments

Comments

@Radiergummi
Copy link

I've set the following log settings:

# log mode (console, syslog, file)
log_mode="file"

# log level: NONE, ERROR, WARNING, INFO, DEBUG
log_level="DEBUG"

# output to log file (required if log_mode is file)
log_file="/var/log/glewlwyd.log"

Still, the log file only shows INFO entries. I just tried updating the email address of my admin user, resulting in a 400 response, showing "Error updating user", because I didn't remove nor set the additional_property_name that is included in the config by default. Now, the erroneous response contained the JSON [{"additional_property_value":"additional_property_value is an optional string between 0 and 512 characters"}], so it's pretty clear what causes the issue (even though the optional slightly confuses me, since it doesn't seem to be optional). I'd expect an error like that to show up in the log, but to no avail:

2018-01-12 18:05:19 - Glewlwyd INFO: Start glewlwyd on port 4593, prefix: api, secure: false
2018-01-12 18:06:50 - Glewlwyd INFO: Glewlwyd caught a stop or kill signal (15), exiting
2018-01-12 18:06:50 - Glewlwyd INFO: Starting Glewlwyd Oauth2 authentication service
2018-01-12 18:06:50 - Glewlwyd INFO: Start glewlwyd on port 4593, prefix: api, secure: false
2018-01-12 18:07:17 - Glewlwyd INFO: Glewlwyd caught a stop or kill signal (15), exiting
2018-01-12 18:07:17 - Glewlwyd INFO: Starting Glewlwyd Oauth2 authentication service
2018-01-12 18:07:17 - Glewlwyd INFO: Start glewlwyd on port 4593, prefix: api, secure: false
2018-01-12 18:08:42 - Glewlwyd INFO: Glewlwyd caught a stop or kill signal (15), exiting
2018-01-12 18:08:42 - Glewlwyd INFO: Starting Glewlwyd Oauth2 authentication service
2018-01-12 18:08:42 - Glewlwyd INFO: Start glewlwyd on port 4593, prefix: api, secure: false

Don't get me wrong, I'm incredibly impressed by Glewlwyd and am determined to use it as the authentication server for my current, large project 😊

@babelouest
Copy link
Owner

I agree, an optional property should be optional indeed. I've added this recently after a feature request but I don't need it myself, so I didn't fully tested all the use cases, and the default configuration is confusing.

In you case, if you don't need this feature, i.e. you don't need an additional key/value in your access tokens, you can comment the line where the additional_property_name value is set, or leave the value blank (""), this will disable the additional property in Glewlwyd.

Concerning the log level, it's by design that I don't leave DEBUG messages in the releases, I prefer having explicit error messages that will help me pointing out where the problem is, without fllooding the user with unncessary debug messages.

In your case, the response body was enough to figure out how to fix, I'll fix the front-end though, so the error 400 can't even be reached. But to me that's another reason not to let cryptic debug messages in the application ;)

@babelouest
Copy link
Owner

Although, thanks for the compliment, it's very much appreciated :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants