Hi all,
I'm in part continuing a topic from over a year ago, where the initial issue (unable to pass a new log4j configuration in the container.javaOptions) has since been resolved:
What I'm noticing now is how extremely painful it is to work up a "compatible" log4j.properties that does something akin to what the default settings produce. I have a 94-line log4j.properties which is in part the log4j.properties shipped with Gerrit (gerrit-war/src/main/resources/log4j.properties), but also contains a fair amount to hook up the sshd_log, httpd_log, error_log, and gc_log, and direct the output to each accordingly.
So, where I'm going with this: should we ship an "example" configuration that people can use as a starting point should they need to override some of the log4j settings? Or, should we contemplate some of the ideas Shawn proposed last year? Obviously, 90+ lines of configuration just to turn down the verbosity on one message (I didn't need the replication status messages that got added recently) is a bit excessive, as well as slightly inflexible, because I didn't find a way (although I can't say one doesn't exist) to point to a relative path, such as ../logs/error_log, so I passed in absolute paths for each logfile.
It's nice being able to completely override the log4j.properties, and direct output as needed to different files. At the same time, for someone who simply wants to turn down the noise slightly on one channel, Shawn's proposal to parse specific channels and set the levels accordingly makes the most sense -- that way, the remainder of the default logging can be set up automatically without having to reinvent the wheel.
Thanks!
--Doug
P.S. I'm willing to share the log4j.properties if anyone else is in a similar bind; it's not amazing, by any means, but it works.