Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Support only logging to syslog #115

Closed
Roguelazer opened this Issue Mar 21, 2012 · 6 comments

Comments

Projects
None yet
3 participants
Contributor

Roguelazer commented Mar 21, 2012

In gh-41, we started alllowing logging to syslog. I'd like to be able to also disable logging locally when logging to syslog.

Contributor

dnephin commented Mar 22, 2012

Right now we have python logging configured from an option to trond (--log-file) and syslog logging configured from the tron config file. I would like to consolidate these so all logging is configured from either options or config.

One advantage to doing it from options is that it gets setup before anything else happens. Doing it after config loading means that config exceptions will be logged to stderr only.

Contributor

irskep commented Mar 22, 2012

That would be my fault. I didn't want you to have to restart trond just to change the syslog config. (Which you had to do anyway for one version until I fixed a dumb mistake.)

It would make more sense to put it all on the command line after trond restarts are made less catastrophic.

Contributor

irskep commented Mar 22, 2012

Further justification: --log-file configures the path to the log file, which is in the same conceptual set of options as other path stuff like working directory, config file location, etc. It's not really 'logging config' in that tron only ever logged one way, to a log file. Now it logs two ways.

Optimally I think we'd be using the Python standard logging config file stuff and configure none of it in our code at all, but that wouldn't play well with tronfig. I think there's a dictionary-based system we can use instead. More on that in a moment.

Contributor

irskep commented Mar 22, 2012

Frick, it's 2.7+ only! http://docs.python.org/library/logging.config.html#module-logging.config

roguelazer, when are we upgrading to Python 2.7?

trollface

Contributor

irskep commented Mar 22, 2012

Found it as a standalone package for 2.6. Up to you guys whether we use it. I vote yea, logging config code sucks.

https://bitbucket.org/vinay.sajip/dictconfig

Contributor

dnephin commented Mar 22, 2012

I like the idea of moving it all into a logging.conf file, and replacing --log-file with something like --log-config. I think we could have it reload that file on SIGHUP. We may not need dictconfig.

@dnephin dnephin closed this in 183d41c Mar 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment