File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Is TOMCAT'S JULI logging levels broken on Linux? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Is TOMCAT Watch "Is TOMCAT New topic

Is TOMCAT'S JULI logging levels broken on Linux?

nico dotti
Ranch Hand

Joined: Oct 09, 2007
Posts: 124
Hi all, I'm pulling my hair out trying to get tomcat logging levels to work. If you're a Tomcat logging guru, please please help! I'm trying to use the java.util.logging as that's fine for my needs and don't want to switch to log4j if at all possible. Thanks in advanced! Here's my issue:

I have custom logging going by putting a file in WEB-INF/classes per the tomcat logging reference docs. I get the custom logs that look like so: dispatch2008-01-31.log. However, when I try to lower the levels of logging I can't seem to get it below Level.INFO logging. HELP!

I haven't checked my jdk logging properties because that would defeat the whole purpose of being able to use log levels dynamically via Tomcat's JULI implementation. I know that it defaults to INFO level so I'm assuming that JULI may not be overriding that level of logging? But the docs say it does?
Apache Logging Reference for Tomcat 6
I've even tried deleting the my app's and hacking the tomcat/conf/ Even tried setting every damn entry to ALL! No dice. Here's an example of one stab at as I had it in my WEB-INF/classes dir:

Here's both files:


and here's the one I have in myapp_root/WEB-INF/classes:

When I try this:

Only the INFO gets logged! Ergh!!! I'm on linux:
Linux toshiba 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux using Kubuntu Gutsy (latest)
Sebastian Leal-Bennett

Joined: Feb 03, 2008
Posts: 2
Hi, I've just spent most the morning on this one! I seem to have it working, try putting:

.level = ALL

after your .handlers entry.
nico dotti
Ranch Hand

Joined: Oct 09, 2007
Posts: 124
Thanks but I think that's what I've already been trying (see sample code in my last post). Did you put this in your project's WEB-INF/classes directory?
Did you have to edit any other files?

For clarity here's what I have in my project's

[ February 03, 2008: Message edited by: nico dotti ]
nico dotti
Ranch Hand

Joined: Oct 09, 2007
Posts: 124
I just did some more testing and noticed I can definitely toggle SEVERE, WARNING, and INFO levels but no lower. Something else is obviously kicking in and preventing this. I have a complex env with flex2 stuff too, and I think that the commons-logging is possibly screwing me up in this area? I've been searching and hacking and searching and hacking some more - hopefully I'll figure this out otherwise I'll be stuck with only the three levels
I agree. Here's the link:
subject: Is TOMCAT'S JULI logging levels broken on Linux?
It's not a secret anymore!