Folks, I am working on analytics for my web application. The application runs on Tomcat 6. I would like to take log entries from a certain logger and put them into a log file of their own. These logs will later be picked up for Map/Reduce processing.
These are the steps I have taken so far:
- In my Java code, I have created a logger specifically for analytics events:
public static final Logger s_analyticsLogger = Logger.getLogger( "com.mm.analytics" );
- I log analytics events using this logger:
s_analyticsLogger.info( "This is an analytics log message" );
- Following Tomcat 6 docs, I created a file
myapp/WEB-INF/classes/logging.properties
and added the following entries to it:
com.mm.analytics.handlers = org.apache.juli.FileHandler
org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/mm-analytics-logs
org.apache.juli.FileHandler.prefix = mm-analytics.
When I run with the above, I see no log file prefixed with mm-analytics created in the Tomcat logs folder. I have also tried moving the configuration entries to Tomcat/conf/logging.properties, but to no avail.
Does anyone know if this is a Tomcat documentation bug or am I doing something wrong?
Thanks.
-Raj