A lot of mucking around, a weekend, 3 beers, and a little sleep latter I
finally answered my own question. So for posterities sake:

My problem was that I started tomcat as a daemon and had assumed that
catalina.sh was being executed by JSVC (expecting those environment
variables to be used), I now realize that I have to build the java command
line myself and pass all parameters to JSVC, specifically:
        
-Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties \
      -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

Hopefully someone else runs into the same blunder and this helps somewhere
down the line.
Dave


-----Original Message-----
From: David Parks [mailto:davidpark...@yahoo.com] 
Sent: Friday, August 13, 2010 8:53 PM
To: 'Tomcat Users List'
Subject: Logging specific info to a separate file

I have a vanilla tomcat, I want to log specific financial-related requests
to a separate log file.

I've added the following logging.properties to webapps/ROOT/WEB-INF/classes:

   handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
   org.apache.juli.FileHandler.level=ALL
   org.apache.juli.FileHandler.directory=${catalina.base}/logs
   org.apache.juli.FileHandler.prefix=financials-
   java.util.logging.ConsoleHandler.level=FINE
 
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
   financials.level=ALL

And in a JSP I have:

   Log financialslog = LogFactory.getLog("financials");
   financialslog.error("test");


I always make mistakes with these logging APIs, probably it's something
simple here, but I'm dumbfounded. Nothing gets logged.

Thanks for any help.
David




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to