commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Koni Roth <konir...@bluewin.ch>
Subject Re: How to configure commons-logging on JDK1.4
Date Fri, 08 Aug 2003 19:00:33 GMT
In my Action I put

    System.out.println("--------> " + log.toString());

in front of the log statement to see what Log is used. It always says

--------> org.apache.commons.logging.impl.Jdk14Logger@61373f


In my 'commons-logging.properties' file I tried things like this:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
  and
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SimpleLog
  and
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SimpleLogFactory 


It always uses Jdk14Logger. I don't get it ;-(  but maybe a cold beer 
would help ;-)

Any comments?

Koni


jbisotti@lexmark.com wrote:

> Koni,
> 
> I find it hard to believe SimpleLog can't be used when using JRE1.4+;
> though I'll admit, after looking at the docs, I still don't really know how
> to do it.  Have you tried placing the following line in
> commons-logging.properties:
> 
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.SimpleLog
> 
> There has to be some way of using it.  Any one with more knowledge have the
> answer?
> 
> 
> Jamie
> 
> 
> 
> 
> 
> Koni Roth <koniroth@bluewin.ch> on 08/08/2003 02:23:36 PM
> 
> Please respond to "Jakarta Commons Users List"
>        <commons-user@jakarta.apache.org>
> 
> To:    Jakarta Commons Users List <commons-user@jakarta.apache.org>
> cc:
> Subject:    Re: How to configure commons-logging on JDK1.4
> 
> 
> Thanks Jamie
> I read an article at http://www.onjava.com/lpt/a/4017 (section Logging,
> point 5). There he says explicit:
> 
> -----
> 5. Finally, if none of the above is valid and the application is not
> running on JRE 1.4 and above, the application uses a built-in SimpleLog,
> which writes everything to System.err.
> -----
> 
> Because my application runs on JRE 1.4, it uses automatic the
> Jdk14Logger. I cannot use SimpleLog on JDK 1.4! Therefore I will use
> Jdk14Logger and not Log4J.
> 
> Thank you, Koni
> 
> 
> jbisotti@lexmark.com wrote:
> 
> 
>>Koni,
>>
>>In short, SimpleLog is not a logging system; some real logging system, be
>>it log4j or jdk logger or whatever, needs to be sitting under the covers
>>when using commons-logging.  commons-logging is simply a wrapper around
> 
> an
> 
>>actual logging system.  In my commons-logging.properties file, I have the
>>following single line, which tells commons-logging to use log4j under the
>>covers:
>>
> 
> org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4jFactory
> 
> 
>>the Log setup information you listed below would go in log4j.properties,
> 
> or its equivalent in any other logging system.
> 
>>HTHs,
>>   Jamie
>>
>>
>>
>>
>>Koni Roth <koniroth@bluewin.ch> on 08/08/2003 12:47:41 PM
>>
>>Please respond to "Jakarta Commons Users List"
>>       <commons-user@jakarta.apache.org>
>>
>>To:    Struts Users Mailing List <struts-user@jakarta.apache.org>,
>>       commons-user@jakarta.apache.org
>>cc:
>>Subject:    Re: How to configure commons-logging on JDK1.4
>>
>>
>>No answer until now! It looks like nobody is using commons-logging!
>>Very frustrating to be the only one using it...
>>
>>Is there really no useful example or documentation?
>>
>>Cheers and enjoy the Friday Beer.
>>Koni
>>
>>
>>-------- Original Message --------
>>Subject: How to configure commons-logging on JDK1.4
>>Date: Fri, 8 Aug 2003 10:11:58 +0200
>>From: Koni <koniroth@bluewin.ch>
>>Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
>>To: commons-user@jakarta.apache.org, struts-user@jakarta.apache.org
>>
>>Hello
>>I'm using Struts 1.1 with commons-logging. My
> 
> 'commons-logging.properties'
> 
>>file is in the CLASSPATH and has the following 2 entries:
>>
>>----
>>org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
>>org.apache.commons.logging.simplelog.log.LogonAction=info
>>----
>>
>>When I run my application the Log should use the 'SimpleLog', as defined
>>in 'commons-logging.properties'. BUT it uses the default logger for my
>>environment
>>org.apache.commons.logging.impl.Jdk14Logger!!!!
>>
>>How can I configure logging to use 'SimpleLog'?? Any examples??
>>
>>Thanks
>>Koni
>>



Mime
View raw message