struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Thielen" <d...@windward.net>
Subject Re: log4j setup
Date Wed, 24 Sep 2003 14:08:58 GMT
I put log4j.jar in the application server lib file - so all web apps are
using the same logger. It has worked fine for me in that configuration.


----- Original Message ----- 
From: "Davide Bruzzone" <Davide.Bruzzone@ngt.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Wednesday, September 24, 2003 7:40 AM
Subject: RE: log4j setup


Here are the steps:

- Make sure that the appropriate Log4J JAR file is in your /WEB-INF/lib
directory
- Put your log4j.properties file in /WEB-INF/classes
- Wherever you want to log, add the following code:

import org.apache.log4j.Logger;

...

// This is a private static attribute within the class
private static Logger logger = Logger.getLogger(<The name of the
class>.class.getName());

...

// When you want to log something...
logger.debug("Something...");

Hope this helps... If you need more information about the
log4j.properties file, etc., the Log4J site points to lots of great (and
very detailed) documentation that you can use as a starting point...

Cheers...

Dave Bruzzone

-----Original Message-----
From: Viral_Thakkar [mailto:Viral_Thakkar@infosys.com]
Sent: Wednesday, September 24, 2003 7:23 AM
To: Struts Users Mailing List
Subject: log4j setup


Please let me know what are the steps one need to do to configure the
log4j.



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


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




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


Mime
View raw message