struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selim Hendrickson <>
Subject Re: Using Log4j in Struts 1.1
Date Thu, 08 Jul 2004 14:31:52 GMT

You have to put the log4j.jar into the lib directory. Then you construct 
the file and put into the classes directory.
Here is a sample file:

log4j.rootLogger=WARN, stdout
log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:ss} 

import org.apache.commons.logging.Log and 

Then use: private static Log log = LogFactory.getLog(nameOfAction.class);

Anywhere you want to print a log message use:

log.trace("Your Message");

That should be all...

Take a look at the structure of the file to find out 
about patterns and log levels. (DEBUG, WARN, etc.)
Pay attention that log.trace() is a certain log level and can be 
log.debug() as well. Take a look at the API.

Hope that helps,


IZTEK Consulting Services
Software Engineer
selimhendrickson [at]
0232 750 6557 wrote:

>Hello All,
>Can anybody send me the steps to config Log4j in struts1.1. Using 
>Alok Garg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message