struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Melonie S. - Contractor" <>
Subject Struts & Tiles & Validator Logging
Date Fri, 07 Mar 2003 15:14:06 GMT
I have noticed a number of posts by people asking how to restrict the
logging for struts/tiles/validator and have noticed responses ranging from
RTFM to detailed info with sample log4j properties files.  

Wishing to reduce the verbosity of the logs, I downloaded the latest log4j
jar, added it in to my lib folder and to the project library, created a file and file and placed both
into my src folder so they would be in my classpath (I'm using Eclipse, so
it gets copied to the classes folder).  I used the properties files from
Eddie Bush's posting (at the end of post), rebuilt my project, fired up
Tomcat and *voila* the log messages continued to spew.  

Trying to cover all of my bases,  I went to the Struts website and looked
under the FAQ's and HowTo's.  None of these documents address logging.  I
then went to the User & Developer Guides.  Section 4.10 says that Struts
uses commons logging and has a link to the commons section of the jakarta
site, but no details on how to configure for Struts.

The Learning More About Struts section of the Jakarta site has a link to the
BaseBeans NewsGroup version of the Struts mailing list - but the Basebeans
server has been down since last fall, so the link doesn't work.  [Suggestion
- change to]. No wonder this question gets asked so
frequently!  Anyway, what steps am I missing in configuring the logging?
I'm using Struts 11B3.

Eddie Bush wrote:
> You really should be able to get such examples off the components' 
> respective sites, but, seeing as how folks seem to have problems with 
> this ... here you go :-)
> <---
> log4j.rootLogger=DEBUG,A1
> # A1 is set to be a ConsoleAppender.
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
> # A1 uses PatternLayout.
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
> <---
> The file says "Hey, commons-logging, I'm 
> using Log4J as my logging implementation!".  From there, you just need 
> to configure Log4J to your needs.  If you need more sophisticated 
> control over Log4J, see the Log4J site:
> Enjoy! ;-)
> Rieberger, Dale wrote:
>> Need an example of a and 
>> files.

View raw message