torproject / sbws Public archive
Conversation
Since sbws migth be run as a system service, it should give some information to the system log. There are no new options to configure for the user, and it's disabled by default.
Have you tested this?
After adding the requested config options, you'll need to use them in configure_logging in sbws/util/config.py. See where the formatters and handlers are set near the bottom of the function.
| @@ -87,6 +87,8 @@ min_relays = 50 | |||
| to_file = yes | |||
| # Whether or not to log to stdout | |||
| to_stdout = no | |||
| # Whether or not to log to syslog | |||
| to_syslog = no | |||
Please add to_syslog_level defaulting to ${level}.
Please add to_syslog_format (feel free to have it default to the string you like instead of ${format}
i added then removed before opening this PR cause thought those settings doesn't probably need to be modified by users, however i'm not sure and it's fine for me to add them
sbws/config.log.default.ini
Outdated
| [handler_to_syslog] | ||
| class=handlers.SysLogHandler | ||
| formatter=to_syslog | ||
| level = INFO |
Please don't set the level here so it is more straightforward to understand what messages will (not) be ignored.
sbws/config.log.default.ini
Outdated
| # syslog-like formatter | ||
| [formatter_to_syslog] | ||
| format = %(asctime)s %(module)s[%(process)s]: <%(levelname)s> %(message)s | ||
| datefmt = %b %d %H:%M:%S |
See previous commit about letting the user set the format with to_syslog_format.
If it isn't necessary to set the date format in order to send messages to the syslog, can we not set it? I've never tried logging to syslog, but I would expect it to set the date format as it wants and not rely on us. But I really don't know.
This section can most likely be empty like the other formatters.
If it isn't necessary to set the date format in order to send messages to the syslog, can we not set it?
it wasn't the case time ago, but i'll check, i think you're right and that's not needed
|
Yes i tested (and worked), will do the modifications you suggest |
|
Made the changes you suggest |
No description provided.
The text was updated successfully, but these errors were encountered: