Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using log4J

 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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


Thank you.

Ayub.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Logging is independent of any particular technology like JSF/JSP/DB2/Websphere. What problem are you facing?
 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

I implemented a simple login app as described here Is there a similar resource where I can try the jakarta commons logging api ?

Also which logging approach is better log4J vs commons


Thank you.
Ayub
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

Thank you for your clear explanation. The point I got from it is as follows:

1) commons logging is the frame work for logging Frame works.

2)I understood that commons logging will delegate logging functionality to log4j or any other loging packages which are detected in the class path.

So the ensence is that log4j is good to use for logging ?

Thank you.

Best Regards
Ayub
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic