One way is to store a file named "commons-logging.properties" in your WEB-INF/classes 
directory, with the following approximate contents:

org.apache.commons.logging.Log = org.apache.commons.logging.impl.SimpleLog

This example sets the logger in use to the "SimpleLog", but you can also use these 
(which are in the same package as "SimpleLog":

Jdk14Logger
Log4JCategoryLog
LogKitLogger
NoOpLog

Each one of these has different ways to configure themselves.

> -----Original Message-----
> From: Wendy Cameron [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 18, 2002 2:46 PM
> To: Struts Users Mailing List
> Subject: RE: Commons-logging and JDK 1.4 Logger
> 
> 
> So how do you configure commons logging to use the logging 
> tool of your choice?
> 
> I thought if you use apache's logging scheme you are then 
> locked into apache's logging functionality.
> 
> Regards Wendy
> 
> > -----Original Message-----
> > From: Eddie Bush [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, November 19, 2002 9:47 AM
> > To: Struts Users Mailing List
> > Subject: Re: Commons-logging and JDK 1.4 Logger
> > 
> > 
> > Mazza, Glen R., ,CPMS wrote:
> > 
> > >Hello,
> > >
> > >I am thinking of using the JDK 1.4 Logging API directly 
> > within some of my
> > >web application classes.  Of course, Struts uses 
> > commons-logging for its
> > >"internal" messages, so I still need to configure 
> > commons-logging to use the
> > >JDK 1.4 Logging.
> > >
> > Yes - so why not just use commons-logging everywhere?  It makes you 
> > independent of any given logging implementation.  Then, if 
> you later 
> > decide you need a syslog logger (oops!  I don't think Java 
> > provides for 
> > this!) or an SMTP logger (oops!  again!) - can you say 
> daily rolling 
> > file appender? - you can just go right over to Log4J, change 
> > a couple of 
> > properties, and voila.  The fact of the matter is that 
> there is some 
> > existing functionality in the Log4J logger implementations 
> > that the JDK 
> > does not have.  Rather than paint yourself in a corner, why 
> > not just use 
> > commons-logging everywhere and be independent of your logging 
> > implementation?
> > 
> > >I am interested in using the same output logging file for 
> > both types of
> > >messages:  those I explicitly call via JDK 1.4 Logging, and 
> > those messages
> > >written by Struts via commons-logging.  Can I have them 
> > append to the *same*
> > >output log file without concern for them overwriting each 
> > other's messages?
> > >
> > I don't see how both objects could have write-access to the 
> > same file at 
> > the same time - I would think this would be problematic.  I'm 
> > not sure 
> > how the logs are implemented, but I would think they would 
> > keep the file 
> > open to speed logging.
> > 
> > >Thanks,
> > >Glen
> > >
> > -- 
> > Eddie Bush
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: 
> > <mailto:[EMAIL PROTECTED]>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to