This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Logging in Struts" Watch "Logging in Struts" New topic
Author

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.
Thanks
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,
Roshani


Regards,<br />Roshani
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hello,

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

Rgds,

Seetesh
amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Any other advantage of Log4j.Which is better in terms of performance.
Thanks
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 ]

Merrill
Consultant, Sima Solutions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Logging in Struts
 
Similar Threads
where to get info about commons logging, log4j and java.util.logging....
Turn off Struts loging.
Does Struts have a log? Can't figure out why ActionServlet is not initializing
Masking Password in log file
log4j prints out undesired Struts messages