Re: using the Standard jdk 1.4 logging with Tomcat 5

2004-10-15 Thread Paul Taylor
Spoke to someone else who had the same problem.
As far as I can see this is a bug in Tomcat, it is unable to find the 
custom formatter unless anyone knows different Ill raise this as a bug.

Paul Taylor wrote:
Did you specify your own formatter in your properties file ?
Ive changed my code from
com.appserver.util.logging.LogProperties.setLevelFromParametersFromPrefs(); 

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

to
com.appserver.util.logging.LogProperties.setLevelFromParametersFromPrefs(); 

LogManager.getLogManager().readConfiguration(com.appserver.util.logging.LogProperties.getPropertiesAsStream()); 


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: using the Standard jdk 1.4 logging with Tomcat 5

2004-10-15 Thread Shapira, Yoav

Hi,
If you file this as a bug, please make sure to include all relevant
files, ideally in one WAR which we can just deploy to our local servers
to reproduce your problem.

Yoav Shapira http://www.yoavshapira.com


-Original Message-
From: Paul Taylor [mailto:[EMAIL PROTECTED]
Sent: Friday, October 15, 2004 11:30 AM
To: Tomcat Users List
Subject: Re: using the Standard jdk 1.4 logging with Tomcat 5

Spoke to someone else who had the same problem.
As far as I can see this is a bug in Tomcat, it is unable to find the
custom formatter unless anyone knows different Ill raise this as a bug.

Paul Taylor wrote:

 Did you specify your own formatter in your properties file ?

 Ive changed my code from


com.appserver.util.logging.LogProperties.setLevelFromParametersFromPref
s();

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

 to


com.appserver.util.logging.LogProperties.setLevelFromParametersFromPref
s();


LogManager.getLogManager().readConfiguration(com.appserver.util.logging
.Log
Properties.getPropertiesAsStream());




 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.setLevelFromParametersFromPref
s();


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: [EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]



-
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using the Standard jdk 1.4 logging with Tomcat 5

2004-10-15 Thread Remy Maucherat
On Mon, 27 Sep 2004 20:11:24 +0100, Paul Taylor [EMAIL PROTECTED] 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 ?

I doubt that this kind of logging configuration can be done in the
webapp, due to classloader visibility.

-- 
x
Rémy Maucherat
Developer  Consultant
JBoss Group (Europe) SàRL
x

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using the Standard jdk 1.4 logging with Tomcat 5

2004-10-07 Thread Paul Taylor
Did you specify your own formatter in your properties file ?
Ive changed my code from
com.appserver.util.logging.LogProperties.setLevelFromParametersFromPrefs();
System.getProperties().setProperty(java.util.logging.config.class, 
com.appserver.util.logging.LogProperties);
LogManager.getLogManager().readConfiguration();
to
com.appserver.util.logging.LogProperties.setLevelFromParametersFromPrefs();
LogManager.getLogManager().readConfiguration(com.appserver.util.logging.LogProperties.getPropertiesAsStream());

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


using the Standard jdk 1.4 logging with Tomcat 5

2004-09-27 Thread Paul Taylor
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: using the Standard jdk 1.4 logging with Tomcat 5

2004-09-27 Thread Jukka Uusisalo
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]