You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Simon McClenahan <sm...@healthcompartners.com> on 2003/11/18 22:26:24 UTC
[logger] Configuring JDK14 logging
I am trying to configure the JDK14 logging via commons-logging, running on Tomcat 5. In my web.xml :
<system-property java.util.logging.config.file="logging.properties"/>
My logging.properties file, which ends up in WEB-INF/classes
--------------------------------
handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
.level=INFO
com.hcp.level=ALL
java.util.logging.ConsoleHandler.level = WARNING
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.level = ALL
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.FileHandler.pattern=EBilling%u.log
java.util.logging.FileHandler.limit=50000
java.util.logging.FileHandler.count=1
--------------------------------
I think the main problem is the system property I set in the web.xml file. Where should logging.properties go in a web app?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [logger] Configuring JDK14 logging
Posted by Sam Berlin <sb...@limepeer.com>.
It requires a resource as visible from your classpath as I understand
it. So, if your classpath includes ".", then you can just have java
-Djava.util.logging.config.file=MyLogProperties MyClass, assuming that
MyLogProperties is in the working directory.
Thanks,
Sam
__matthewHawthorne wrote:
> Somebody please correct me if I'm wrong, but I believe that
> java.util.logging.config.file expect an absolute path. I hate this.
>
> What I've always had to do is use the java.util.logging.config.class
> property to load a small class which loads my config file and sets the
> props into the LogManager.
>
> Unless somebody else can chime in with a more elegant solution, this may
> be what you have to do.
>
>
>
>
> Simon McClenahan wrote:
>
>> I am trying to configure the JDK14 logging via commons-logging,
>> running on Tomcat 5. In my web.xml :
>>
>>
>>
>> <system-property java.util.logging.config.file="logging.properties"/>
>>
>>
>>
>> My logging.properties file, which ends up in WEB-INF/classes
>> --------------------------------
>>
>>
>> handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
>> .level=INFO
>> com.hcp.level=ALL
>>
>> java.util.logging.ConsoleHandler.level = WARNING
>> java.util.logging.ConsoleHandler.formatter =
>> java.util.logging.SimpleFormatter
>>
>> java.util.logging.FileHandler.level = ALL
>> java.util.logging.FileHandler.formatter =
>> java.util.logging.SimpleFormatter
>> java.util.logging.FileHandler.pattern=EBilling%u.log
>> java.util.logging.FileHandler.limit=50000
>> java.util.logging.FileHandler.count=1
>>
>>
>> --------------------------------
>>
>>
>> I think the main problem is the system property I set in the web.xml
>> file. Where should logging.properties go in a web app?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
> .
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [logger] Configuring JDK14 logging
Posted by __matthewHawthorne <ma...@phreaker.net>.
Somebody please correct me if I'm wrong, but I believe that
java.util.logging.config.file expect an absolute path. I hate this.
What I've always had to do is use the java.util.logging.config.class
property to load a small class which loads my config file and sets the
props into the LogManager.
Unless somebody else can chime in with a more elegant solution, this may
be what you have to do.
Simon McClenahan wrote:
> I am trying to configure the JDK14 logging via commons-logging, running on Tomcat 5. In my web.xml :
>
>
>
> <system-property java.util.logging.config.file="logging.properties"/>
>
>
>
> My logging.properties file, which ends up in WEB-INF/classes
> --------------------------------
>
>
> handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler
> .level=INFO
> com.hcp.level=ALL
>
> java.util.logging.ConsoleHandler.level = WARNING
> java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
>
> java.util.logging.FileHandler.level = ALL
> java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
> java.util.logging.FileHandler.pattern=EBilling%u.log
> java.util.logging.FileHandler.limit=50000
> java.util.logging.FileHandler.count=1
>
>
> --------------------------------
>
>
> I think the main problem is the system property I set in the web.xml file. Where should logging.properties go in a web app?
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org