This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

writing a wrapper class around log4j

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

does anyone please give me some start up documents on how to write a wrapper class around log4j. Basically my project requirement is to use the wrapper class to make the logging instead of directly using log4j classes.

Pls provide me some code samples if have.

regards,
hari
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're in luck - such a wrapper already exists! It's called Jakarta Commons Logging, and can wrap around java.util.logging, log4j and System.out.
 
pulijala hari
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Ulf Dittmer,

Thank you.., but we do not want to import the commons into our project.I might need a simple interface and or a class which i can use to instantiate the logger(category). do you have any code samples.., help is highly appreciated.
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jakarta Commons Logging is open source.
As Ulf says, they have done what you want to do.
Their source code is available on
http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi (search for source 1.1.zip).
You can browse for the log4j wrapper source online: http://svn.apache.org/viewvc/jakarta/commons/proper/logging/trunk/src/java/org/
apache/commons/logging/impl/Log4JLogger.java?view=log
.

Regards, Jan
[ April 26, 2007: Message edited by: Jan Cumps ]
 
I am displeased. You are no longer allowed to read this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic