> So how do you configure commons logging to use the logging tool of your
choice?

Create a commons-logging.properties file and define the following property

org.apache.commons.logging.LogFactory

example

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

If the implementation is log4j, you have to define the configuration of
log4j independent of the commons logging configuration.

Check out the jakarta site for more info.

- Shravan



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]>

**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

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

Reply via email to