• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Log4J questions?

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm about to start a project using Log4J and have a few questions...
a) Is it a good idea to have lots of loggers? I've read that people often create a logger for each class, but is this really efficient?
b) I'm guessing that an AsynchAppender is more efficient as it performs formatting in a separate thread, but is it resilient? What if the logger thread dies, do the messages get lost?
c) Any real does and don't for a performant and robust solution...
Thanks,
Paul.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When i use log4j i normaly write my own logger class from which i let all my classes extend. The advantage in this case is, that i so can write the
class name to the log file. Otherwise i would have to do that manually. But so each logging entry has the class name as an identifier.
This is what worked best for me.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic