How can I implement log4j logging to an existing J2EE Struts web application?

Posted by Ruepen on Stack Overflow See other posts from Stack Overflow or by Ruepen
Published on 2010-05-06T13:25:12Z Indexed on 2010/05/06 13:28 UTC
Read the original article Hit count: 147

Filed under:
|
|

I have recently inherited a J2EE Struts web app that was written back in 2002. There is no logging in the application other than the odd System.out.println().
I have added log4j logging so that I can write out some info to the console, but I'm concerned on how best to approach this. Any suggestions, tips, best practices would be welcome as I don't want to spend too much time adding logging to every method or class (or trying to find what places where logging would be best - ie. bad code blocks/defects).
My current approach is to just add some logging to the few classes that I have been looking at to understand the code, but are there a few key places where I can add logging to maximize my use of adding log4j?

© Stack Overflow or respective owner

Related posts about java

Related posts about log4j