Hi everyone,
I am pretty new to Apache Tomcat; I have been playing around with it years ago but never got to a productive state until now. So I started another trial, but I keep hanging at the same points. I have also been scanning much material, and even it seems to be an easy issue (even to me...) I just can't find how to solve it. I suppose I am just missing a tiny little trick...
I was trying to get some proper logging from my Java classes in TomCat 8.0.9 (new, standard installation on Windows 7). I placed a logging.properties file in WEB-INF\classes:
I use these lines in my code:
And there is the standard logging.properties in the Tomcat 8.0\conf directory. When starting TomCat and using my WebApp (invoking save()), I see the SEVERE message (as well as other WARNING and INFO), but no finer ones. I have pretty much the same problem with log4j as well, but now I switched back to the juli logging.
Does anyone see where I missed out? I have been trying dozens of variations, most of which I would think they should work, but they never do. What else do I have to consider?
Thanks a lot,
Stephan
I am pretty new to Apache Tomcat; I have been playing around with it years ago but never got to a productive state until now. So I started another trial, but I keep hanging at the same points. I have also been scanning much material, and even it seems to be an easy issue (even to me...) I just can't find how to solve it. I suppose I am just missing a tiny little trick...
I was trying to get some proper logging from my Java classes in TomCat 8.0.9 (new, standard installation on Windows 7). I placed a logging.properties file in WEB-INF\classes:
Code:
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
org.apache.juli.FileHandler.level = ALL
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = Gourmet01.
java.util.logging.ConsoleHandler.level = ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
I use these lines in my code:
Java:
...
import java.util.logging.*;
public class Customer {
static Logger logger = Logger.getLogger( Customer.class.getName() );
public String save() {
...
logger.log( Level.SEVERE, "message 1");
...
logger.log( Level.FINEST, "message 7");*/
return "/showCustomer.xhtml";
}
}
And there is the standard logging.properties in the Tomcat 8.0\conf directory. When starting TomCat and using my WebApp (invoking save()), I see the SEVERE message (as well as other WARNING and INFO), but no finer ones. I have pretty much the same problem with log4j as well, but now I switched back to the juli logging.
Does anyone see where I missed out? I have been trying dozens of variations, most of which I would think they should work, but they never do. What else do I have to consider?
Thanks a lot,
Stephan