You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John C Cartwright <Jo...@noaa.gov> on 2003/05/07 01:21:56 UTC

Re: getting commons logging to work - Thanks!

Thanks to All! It now seems to be working, although I still need to do 
some log4j tuning.  File permission problems were at least part of the 
issue.

What is the general consensus on where a Struts web application should 
keep it's log files?

Thanks again!

-- john


Chris Halverson wrote:
> "John C Cartwright" <Jo...@noaa.gov> writes:
> 
> 
>>I have log4j configured (via properties file) and commons logging
>>configured to use it (also via properties file).  When I create a
>>standalone application, it uses the log4j logger fine, but I can't
>>seem to get any of my Struts classes to write to the logs.  Not seeing
>>any exceptions - can anyone suggest what I might be doing wrong or
>>point me to a working example?
> 
> 
> I struggled with this forever for some reason too, coming back to it
> off and on until I finally got it to work. I am using Struts 1.1rc1. I
> removed my commons-logging.properties file entirely as 1.1 will use
> log4j if it finds it in the class path. My log4j.properties (which is
> copied into the WEB-INF/classes dir during build) is just:
> 
> # Create two appenders, one called stdout and the other called rolling
> log4j.rootLogger=DEBUG, rolling
> 
> # Configure the rolling appender to be a FileAppender
> log4j.appender.rolling=org.apache.log4j.FileAppender
> 
> # Configure the name of the logout for the rolling appender
> log4j.appender.rolling.File=/tmp/portal-cdh.log
> 
> # Configure the Layout pattern and conversion pattern for the rolling
> # appender
> log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
> log4j.appender.rolling.layout.ConversionPattern=%d %-5p (%F:%L) - %m%n
> 
> # Quiet Struts down a bit
> log4j.category.org.apache.commons=WARN
> log4j.category.org.apache.struts=WARN
> 
> 
> I really want a RollingFileAppender, but for some reason it's just not
> working. It's not a big deal though, and once I changed from Rolling
> to just a FileAppender, everything just worked.
> 
> HTH.
> 
> cdh
> 


-- 
=====================================================
John Cartwright
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6284
John.C.Cartwright@noaa.gov
=====================================================



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org