Just drop this file into WEB-INF/classes and select the LogFactory and
Log
implementation of choice.

#
# commons-logging.properties
#

#-----------------------------------------------------------------------
-------
# Select LogFactory:
#-----------------------------------------------------------------------
-------
# Dynamically selects logging implementation class according to the
following:
#
# - Use a factory configuration attribute named
org.apache.commons.logging.Log 
#   to identify the requested implementation class. 
# 
# - Use the org.apache.commons.logging.Log system property to identify
the 
#   requested implementation class. 
#
# - If Log4J is available, return an instance of 
#   org.apache.commons.logging.impl.Log4JCategoryLog. 
#
# - If JDK 1.4 or later is available, return an instance of 
#   org.apache.commons.logging.impl.Jdk14Logger. 
#
# - Otherwise, return an instance of
org.apache.commons.logging.impl.NoOpLog. 
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Lo
gFactoryImpl
#
# Directly selects log4j logging implementation class.
#org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.L
og4jFactory

#-----------------------------------------------------------------------
-------
# Select Logging implementation class
#-----------------------------------------------------------------------
-------
# Simple commons-logging implementation (uses simplelog.properties)
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLo
g
# Maps to a Log4J category (uses log4j.properties)
#  note: org.apache.log4j.Category is deprecated in favor of
org.apache.log4j.Logger
#  and requests for a Category object will return a Logger object.
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCate
goryLog
# Wraps standard JDK1.4 logging mechanisms
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Log
ger
# Wraps jakarta-avalon-logkit
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogKitLo
gger
# Throw away all messages, no configuration
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog


> -----Original Message-----
> From: Wendy Cameron [mailto:[EMAIL PROTECTED]] 
> Sent: Monday, November 18, 2002 5: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:struts-user-> [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