• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging in Struts

 
amit sharma
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the best approach for logging in struts .Log4j or any other framework
is suitable for struts application.
Thanks
 
RoshaniG Gopal
Ranch Hand
Posts: 180
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi dmay,
I believe log4j is the easiest and the best way for logging.

Regards,
Roshani
 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any other advantage of Log4j.Which is better in terms of performance.
Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic