This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Performance Issues with Logging

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Logging open sources like log4j and Logger( as implemente dy sun) has various levels of logging (debug, info, warm fatal etc).
If, we sett the logger a level, let us say info, the debug messages will not be printed. yet, it first prepares the message that needs to be printed and only then looks for the level. As this process involves a lot of String manipulations, the performance of the application goes down even though we set the level to info. We conducted a performance test and the performance downgrade was evident.
My question is
1. Is there a better logging framework which would give a performance better than Log4j?
2. Is the issue I pointed out addressed in any of the open source packages?
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you taken a look at the log4j manual? There is a heading in that page called "Performance".

Does isDebugEnabled() not sufficiently address your concern about String manipulations to prepare the message?

Quote from performance section of log4j manual, "To avoid the parameter construction cost write: "
 
Skool. Stay in. Smartness. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!