File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Logging in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Logging in Struts" Watch "Logging in Struts" New topic

Logging in Struts

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
What is the best approach for logging in struts .Log4j or any other framework
is suitable for struts application.
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi dmay,
I believe log4j is the easiest and the best way for logging.


Regards,<br />Roshani
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244

Though Struts uses Apache Common Logging framework to take care of its logging, I would prefer Log4j ( for its support for different layouts.


amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Any other advantage of Log4j.Which is better in terms of performance.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Apache commons logging is a kind of wrapper for other logging frameworks. If you've initialized Log4j logging in your application, Apache commons logging will sense it and use Log4J as the logging implementation.

Here's a quote from the home page:
The Logging package is an ultra-thin bridge between different logging implementations. A library that uses the commons-logging API can be used with any logging implementation at runtime. Commons-logging comes with support for a number of popular logging implementations, and writing adapters for others is a reasonably simple task.

[ October 05, 2006: Message edited by: Merrill Higginson ]

Consultant, Sima Solutions
I agree. Here's the link:
subject: Logging in Struts
It's not a secret anymore!