File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Log4j versus Apache Commons logging" Watch "Log4j versus Apache Commons logging" New topic

Log4j versus Apache Commons logging

gyanendra ojha

Joined: May 16, 2007
Posts: 11
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

Joined: Oct 29, 2001
Posts: 9167

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.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Log4j versus Apache Commons logging
jQuery in Action, 3rd edition