-
Notifications
You must be signed in to change notification settings - Fork 141
wptagent log local logs syslog rfc5424 #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@pmeenan If you could take a look, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM but the flag behavior is a bit confusing. It might be cleaner to always use verbosity to set the log level and just use a different flag to switch logging into Rfc 5424 mode. That way log file and verbosity params would be consistent. I'm good either way though.
wptagent.py
Outdated
# logging_level has priority over other parameters. | ||
# When specified the logging to file will be the only allowed type of logging. | ||
# Must be used in conjunction with log_file. | ||
if logging_level != None and log_file != None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, is not None
is core consistent python with the existing code
if logging_level is not None and log_file is not None:
…factored setup_logging to leverage verbosity
@pmeenan I refactored as suggested, works well too. |
ref 177487
RotatedFileTransport(StreamTransport)
ininternal\rfc5424logging\transport.py
to support an external tool rotating the log file (e.g. logrotate, logstash, etc.).rfc5424logging_context.py
and relative classLoggingContext
to store structured logging context to enhance each log while keeping backward compatibility with other types of logs.* Added additional option--loglevel
and refactored log level option handling intosetup_logging
class to support current log format an the new introduced rfc5424 log format.--logformat
and refactored log level option handling intosetup_logging
class to support. It reuse--verbose
option and--log
to set the log file path and verbosity. Only supports new introduced rfc5424 log formatsyslog
.After this PR is approved all log entries will be updated to add the new logging context.