I am trying to implement logging facility in my web application (JSF/JSP/DB2/) application will be deployed on Websphere application server. I will be thankful if any one can give me a sample hello world webapp which implements Log4J functionality on the above platform
Also which logging approach is better log4J vs commons
I think you are confused. log4j is a logging framework i.e. it provides the mechanism to log messages from your code, plus a bunch of method to configure and control that logging process. Commons logging is a framework for logging frameworks. What that means is commons logging itself does not log. It delegates to a configurable logging framework (such as log4j) to log the actual messages. What it provides is an abstraction layer on top of the various logging frameworks so you don't need to worry about the differences between each logging framework.
It is generally better to use the more abstract API.