Commons Logging will initialize Log4j automatically if it's present, so
you don't need to do that. You do need log4j.jar in your lib directory,
though, if you want to use it. You can then write your logging using
either the Log4j API directly or using the Commons Logging API,
whichever you prefer.
Refer to the Commons Logging documentation for more information:
http://commons.apache.org/logging/
L.
Raghuveer wrote:
Hi,
I understand for struts project there needs be commons-logging.jar needs to
be placed in web-inf\lib folder.
Incase if I want to use Log4j for logging logs related to my own application
only ,is it required to configure log4j again and place 1og4j.jar in
web-inf\lib.
At present i have written some plugin class to initialize log4j separately
for my struts application..
Please let me know Instead of configuring log4j for my java files ..is it
not possible to use commons logging?
-----Original Message-----
From: Chris Pratt [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 10, 2008 10:39 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Commons logging in struts
On Jan 10, 2008 1:25 AM, Raghuveer <[EMAIL PROTECTED]> wrote:
Could any one provide information of using commons logging for logging my
application related logs in my JSP-STRUTS application
Commons logging is just a logging facade, it is not a logging system
itself. It is used by libraries and frameworks so that the authors
can write logs that will eventually get logged to whatever logging
system the end user decides to embrace.
With that in mind, what you probably really need to decide is which
logging system you want to use. The two most popular are definitely,
the one built into Java (java.util.logging.*) and Log4j
(http://logging.apache.org).
One other thing you might want to look into is a more advanced facade
SLF4j (http://www.slf4j.org).
(*Chris*)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]