tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject Re: using the Standard jdk 1.4 logging with Tomcat 5
Date Thu, 07 Oct 2004 16:26:47 GMT
Did you specify your own formatter in your properties file ?

Ive changed my code from

System.getProperties().setProperty("java.util.logging.config.class", "com.appserver.util.logging.LogProperties");



Now I dont get any errors and only messages for the LEVEL is set to the 
value I specify in my LogProperties class are displayed. However I also 
specify a Formatter to use for console output but Tomcat just seems to 
ignore it and uses its own default formatter.

Jukka Uusisalo wrote:

> Hi,
> I have used jdk 1.4 logging  with  tomcat  5.0.x without any problems, 
> but i have configured logging with java.util.logging.config.file 
> property and
> config file.
> - Jukka -
> Paul Taylor wrote:
>> Hi in a previous non Tomcat project I wrote some classes that used 
>> the java.util.logging library that comes with java 1.4 quite 
>> successfully. I am now trying to use the same classes with Toimcat 
>> 5.0 but it doesnt like it. With the logging classes you can provide a 
>> configuration class which you define with a property 
>> "java.util.logging.config.class", I put the class in my 
>> WEB_INF\classes with all the other classes.
>> When I run with Tomcat i have a servlet that does the following to 
>> try and initilse the logging
>> com.appserver.util.logging.LogProperties.setLevelFromParametersFromPrefs(); 
>>  System.getProperties().setProperty("java.util.logging.config.class", 
>> "com.appserver.util.logging.LogProperties");
>>  LogManager.getLogManager().readConfiguration();
>> it complains it cant find the class, when running 
>> readConfiguration(), (The 1st two lines run ok). I think the problem 
>> is to do with Tomcat classloader, with a simple Java application the 
>> classes would be expected to be on the system classpath, but on 
>> Tomcat the system classpath only contains bootstrap.jar.
>> I realise I could probably get things working using Apaches log4j 
>> instead but it seems a bit silly to use that when there is a 
>> perfectly adequate logger built into the language now.
>> Anyone done this ?
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message