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
ability to log to syslog not just files #221
Conversation
-o syslog will log to syslog
logger.addHandler(file_handler) | ||
if output == 'syslog': | ||
syslog = logging.handlers.SysLogHandler('/dev/log', facility=LOG_DAEMON) | ||
syslog.setLevel(logging.INFO) |
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.
what is this, indentation for ants?
Can you add some documentation? |
added doc comment
useful if ur using mac, as the file is in /var/run/syslog or smt, not /dev/log as on most linuxes |
if isSock: | ||
syslog = logging.handlers.SysLogHandler(output, facility=LOG_DAEMON) | ||
syslog.setLevel(logging.INFO) | ||
syslog_formatter = logging.Formatter('%(name).24s[%(process)d]: %(message)s') |
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.
Why aren't we respecting the formatter here?
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.
if formatter is None:
formatter = logging.Formatter('[%(asctime)s] %(levelname)-7s %(message)s')
this format kinda sucks for syslog
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.
It's nonstandard behavior for beaver. If we want to change the defaults, fine, but this change makes it more difficult to reason about how it runs.
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.
Ok then all logging should be done in some stadart way by means ob logging.{conf/yml} whatever,
this functions does too much magic (overriding handlers for instance in ex. ) even without my patches
This is a great feature. IMHO if logging to syslog, it should use syslog format. |
use standard python logging.* configured via logging.ini
well now everyone can tune logging to their likeing |
no use of handlers basicConf is not needed
Hey @andrus7k, I'm just trying to do a bit of, much needed, housekeeping on the PRs. This looks good, is it still required? If so, please can you fix the merge conflicts and add tests cases around your new functionality so I can get this pulled in, if it's not required anymore I'll go ahead and close PR. Thanks! |
Ping @andrus7k I'll close this off in a couple of days with the assumption this PR isn't required any more. |
Closed due to inactivity. Please reopen if you get chance to finish it off. |
-o syslog will log to syslog