I've been trying to get logging working correctly using the default logging configuration model for tomcat 6.
My Goal is to get each app logging into its own rolling file. For the point of this question/example lets say I have one application named "My-App".
I started with the example provided in the docs, and added an extra handler called "4myapp". I then tried to copy how the "manager" application delegates a context to a hander (at the bottom).
I'm not sure what I have done wrong, however the log "myapp.2011-12-02.log" remains empty, while catalina.out clearly contains logging for this application. "manager.2011-12-02.log" is also getting populated when I browse the manager application.
handlers = 1catalina.org.apache.juli.FileHandler, \
2localhost.org.apache.juli.FileHandler, \
3manager.org.apache.juli.FileHandler, \
4myapp.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.
3manager.org.apache.juli.FileHandler.bufferSize = 16384
4myapp.org.apache.juli.FileHandler.level = FINE
4myapp.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4myapp.org.apache.juli.FileHandler.prefix = myapp.
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].[/My-App].level = FINE
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/My-App].handlers = \
4myapp.org.apache.juli.FileHandler
If someone could explain where I have gone wrong, that would be great!
ps the '-' in My-App is required - the context name i have replaced in the eg contains a dash (i cannot change this). hopefully that's not the cause of the problem.