Re: Help with Log Level in Tomcat 6 Logging
Konstantin, Thanks very much for your time. Your explanation makes things clearer. cheers Jon On 17 June 2010 14:37, Konstantin Kolinko knst.koli...@gmail.com wrote: 2010/6/17 Jonathan Jackson jonathan.x.jack...@gmail.com: The problem I have is that in my daily rolling catalina-[data].out I only get SEVERE level messages. Given the above configuration, my understanding from reading this ( http://tomcat.apache.org/tomcat-6.0-doc/logging.html) is that FINE for the FileHandler would log everything above ie. FINE,CONFIG,INFO,WARNINGBut Im only getting SEVERE written to my daily rolling logfile. The Tomcat JULI logging is an implementation of java.util.logging (aka JUL), which documentation is here, http://java.sun.com/javase/6/docs/api/java/util/logging/package-summary.html#package_description http://java.sun.com/javase/6/docs/api/java/util/logging/Level.html http://java.sun.com/javase/6/docs/technotes/guides/logging/index.html etc. To make a brief summary, there are two levels where log messages are filtered: a) at the category (aka logger) level If level of a category (if not specified then its parent level is taken) does not match the message, it will be rejected by the logging system and will not be processed at all. That is what these lines are for: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level org.apache.catalina.core.AprLifecycleListener.level The categories form a hierarchy, and the default level is specified by .level= INFO Note, that the org.apache.catalina.core.ContainerBase.[Catalina].[localhost] category is for the messages logged through Servlet.log() API calls, which I think is rare. Usually applications use commons-logging calls and their category names are different. Thus the defaults (.level=INFO) apply to them. There is no .level= INFO in Tomcat's logging.properties because the defaults are provided by JRE through its logging.properties. But you can always add such a line by yourself, e.g. .level= FINEST will cause a lot of messages being processed b) when writing the message out (aka handler) level If handler level does not match the message, it will be skipped (but may be printed by other handlers). categoryname.handler setting attaches handlers to a category. I think you missed a). By the way, .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler I hope that those lines were wrapped by the mailing software. You cannot wrap lines in a properties file like that (though you can if you end previous line with '\'). see java.util.Properties JavaDoc. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Help with Log Level in Tomcat 6 Logging
Hello, Im a newbie to Tomcat logging. Here is the logging.properties of my Catalina installation: --- handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler # Handler specific properties. # Describes specific configuration info for Handlers. 1catalina.org.apache.juli.FileHandler.level = FINE 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = catalina. 2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. 3manager.org.apache.juli.FileHandler.level = FINE 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 3manager.org.apache.juli.FileHandler.prefix = manager. 4host-manager.org.apache.juli.FileHandler.level = FINE 4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 4host-manager.org.apache.juli.FileHandler.prefix = host-manager. java.util.logging.ConsoleHandler.level = FINE java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Facility specific properties. # Provides extra control for each logger. org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler # For example, set the com.xyz.foo logger to only log SEVERE # messages: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.session.ManagerBase.level = FINE #org.apache.catalina.core.AprLifecycleListener.level=FINE The problem I have is that in my daily rolling catalina-[data].out I only get SEVERE level messages. Given the above configuration, my understanding from reading this ( http://tomcat.apache.org/tomcat-6.0-doc/logging.html) is that FINE for the FileHandler would log everything above ie. FINE,CONFIG,INFO,WARNINGBut Im only getting SEVERE written to my daily rolling logfile. Im not sure how to change this behaviour even after reading through - http://tomcat.apache.org/tomcat-6.0-doc/logging.html - and any advice is appreciated. Thanks Jon