[logback-user] Some logback-access questions

Mike Wartes mikew at bluenile.com
Fri Dec 16 17:43:37 CET 2011


Hello,

I've been trying out the logback-access module as a potential replacement for Tomcat's AccessLogValve. I've run into a couple of issues that I'm wondering if anyone can help with.


1.       It doesn't look like logback-access has the ability to print the query string like the %q value of Tomcat's AccessLogValve does. Am I missing something, or are there any workarounds? Unfortunately this is actually a dealbreaker for me if I can't make it work, since I need to have query strings in my access logs.

2.       This one isn't a dealbreaker, but I'd like to configure one access log per webapp in my Tomcat container instead of one access log for all webapps. My first thought was that it'd be simple enough to configure the LogbackValve under each webapp's Context instead of under the Host element like the documentation suggests. However, I got stuck because of the way the LogbackValve is looking up its configuration file. I can't put the logback-access file in the container's conf directory because I want separate configuration per webapp. I also can't specify a relative path to the right webapp's folder because it can be in different places in different environments (the webapp files might not be in the container's folder at all). If I could look the configuration file up on the classpath I think that'd be pretty ideal, but from what I can tell it doesn't seem like that's possible.

Any suggestions? I'm loving logback-classic and was excited to see that there is a module for access logs as well, but for the time being I think I may have to go back to the AccessLogValve.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111216/27a0e775/attachment.html>


More information about the Logback-user mailing list