• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

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 ]
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic