aspose file tools*
The moose likes Struts and the fly likes Log4j versus Apache Commons logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Log4j versus Apache Commons logging" Watch "Log4j versus Apache Commons logging" New topic
Author

Log4j versus Apache Commons logging

gyanendra ojha
Greenhorn

Joined: May 16, 2007
Posts: 11
Hi,
I want to implement Logging in my Struts Application. I have two options for logging "Log4j and Apache commons Logging" .
Please, suggest me which one is the best option for a Struts application.
and why ?

please, reply as fast as you can.
Thannks in Advance.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Originally posted by gyanendra ojha:
please, reply as fast as you can.


Please, Ease Up. We're all volunteers here, answering questions in our spare time.
As for your question, Apache Commons Logging is a wrapper around java.util.logging, Log4j and others. If you don't know which to choose, Apache Commons Logging is the safe choice since you can change the underlaying logger without rewriting your code.
Personally, I always use Log4j for no other reason than it works for what I need it to do.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Log4j versus Apache Commons logging