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
Shain/client logger #23
Conversation
How is this different from the output formatters and report handlers? |
More on @adamhjk's comment - why do we need this? Is there something our current logging solution doesn't offer? |
@adamhjk @sethvargo To the best of my knowledge, currently we only have one logging 'device' (the MonoLogger) which by default goes to STDOUT. You can also add the log_location to make it go to a file, and there's an override to make it do both if you want. This doesn't really enable multiple file, multiple output devices (other than these 2) or redirection (other than manually) The formatters only apply to output that the 'user sees' which means they only get applied to things being logged to STDOUT. This doesn't change that concept or the functionality of that at all (it's pretty awesome as it is). What this would allow is for folks to create their own loggers to resolve things like this syslog issue - although this would be included in this implementation. This does leverage a lot of our current solution (mixlib/log etc) but offers a more "pluggable" way to add a new logger in a well defined way. |
If you were going to add this, it probably belongs in Mixlib::Log, and you A version of this that ignores the back-compat won't be acceptable to me, On Fri, Jul 18, 2014 at 11:34 AM, Scott Hain notifications@github.com
|
@adamhjk The idea is to have this be an 'opt-in' model that can mimic the functionality of the old style if configured correctly. It doesn't actually change the behavior of the current model at all, so if you never add a 'new' style logger, you'll never see the change. One of the big impetuses of this is that in the last logging refactor, we actually broke people's workarounds (as colorfully documented here). The other is the Windows logging stuff that @adamedx is working on right now - this would allow for multiple loggers to send different formats of output to different Windows log mechanisms without having to do crazy things. The reason I don't think this belongs in mixlib/log itself, is mostly because mixlib/log (as far as I can tell) really defines the log levels, sets up a standard 'interface' to each log, and aggregates all the loggers you add to it. It doesn't actually have any log device functionality inside it. |
In fact I think it would be cool to give I don't think this changes the most things in this RFC. Totally 👍 on preserving 100% backwards compatibility. |
|
||
### Configuration | ||
|
||
#### (potentially) Deprecated Configurations |
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.
We don't need to deprecate any of this functionality in order to make this work. So I'd replace this section with a section talking about how the backwards compat will be achieved.
A couple of questions:
That is not to say config cleanup and syntax helpers are a bad thing, I'm just making sure I have the scope of the project right.
|
|
||
#### Chef::Loggers::WindowsEventLogger | ||
TBD - name may change - see [Windows Logging RFC](https://github.com/opscode/chef-rfc/blob/adamed/windows-logging/rfc0002-windows-logging.md) (link may change) | ||
|
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.
Given the number of distributions that are moving to systemd, it might be interesting to include a journald logger in this list.
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.
Actually @stevendanna this works:
(adding syslog-logger to the Gemfile first)
require 'syslog-logger'
Chef::Log.use_log_devices( [ Logger::Syslog.new("chef-client", 8) ] )
I'm with @stevendanna |
If part of the goal here is to simplify configuring multiple loggers, some prior art that might help: https://docs.djangoproject.com/en/1.7/topics/logging/#examples |
You can also look at Log::Log4perl, which is a Log4j port, which is the http://mschilli.github.io/log4perl/ On Fri, Jul 18, 2014 at 3:42 PM, Noah Kantrowitz notifications@github.com
|
thanks @adamhjk, @coderanger - to be honest I based some of the concept on the way slf4j interacts with other Java loggers (logback, log4j, etc) since that's kinda my background. I'll definitely check out these two for more context/inspiration also to be clear - my motivation for this is as follows (in order of importance) |
I also wrote Logify |
This will be revisited and a new RFC will be created following the new RFC guidelines. |
🚧 Still some things not quite fleshed out, but a good starting place.
Basically, this proposes a new logging framework/style that retains backwards compatibility (if needed) and allows a simpler, more modular approach to creating and configuring loggers for the chef client. Also included would be some new loggers giving native support for syslog (finally!) and Windows (covered in a separate RFC)