-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Log4j config with module #154
Conversation
This seems to be ok. It just needs to be squashed and pass tests. |
As a bit of a side note, I'm slightly concerned with the growing number of parameters. Might need to raise another issue about that. |
@liamjbennett I'll get on that. Re: params number, I think that's the sign of a healthy and extensible module. Have you looked at https://github.com/jfryman/puppet-nginx? The curse of being easily-modifiable is a lot of code it seems. |
Tests fail because the module expects the file to be XML. I wonder if this will be harder than I thought. Rundeck may be using a nonstandard config. |
Yuck. I didn't notice that danielgil/log4j was only for the XML-formatted log4j.
Not necessarily; the Java properties format is much simpler than XML and, I suspect, the puppetlabs/inifile should suffice.
No, Java properties like this are very common (possibly more common than XML, for logging, at least). As far as the interface goes, I was thinking of something more like a few defined types, simliar to the rundeck::log4j::logger { 'org.codehaus.groovy.grails':
level => 'info',
appender => ['stdout', 'server-logger'],
additivity => false,
} I would probably also have a generic appender config that used the 3rd-level component (e.g., "cmd-logger" in "log4j.appender.cmd-logger.file") as the title and the 4th-level as parameters (with a special "classname" or "appenderclass" or "appender" for the appender Java class name, since that's otherwise at the 3rd level; I'm uncertain about using "class" as a parameter name). $logdir = $rundeck::config::service_logs_dir # lazy abbrev
rundeck::log4j::appender { 'server-logger':
classname => 'org.apache.log4j.DailyRollingFileAppender',
file => "${logdir}/rundeck.log",
datePattern => "'.'.yyyy-MM-dd",
...
} Given that almost all of the default appenders have basically the same configuration, aside from file and ConversionPattern, it probably makes sense to make all that the default. You might even start with a generic rundeck::log4j::setting { 'log4j.rootLogger':
value => 'warn, stdout, server-logger',
} (I started calling this I probably wouldn't have anything in (Wow, didn't quite mean for this to go on so long; I hope this isn't too much.) |
@wcooley I'm quite against making rundeck manage log4j itself; using an external module, even if it's complex, would be preferable. I would rather be ready for the Rundeck devs to pivot to shipping an XML format, or the log4j devs changing their formatting, than to update some custom logic. |
+1 |
Closing as I don't have time to work on this at the moment. |
This is a WIP to solve #85.
Tag @wcooley