This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

log4j performance on limits

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone share insight into performance questions with log4j? Specifically, I have code with various levels of logging running under jboss5. Lots of info, debug, and trace.

If I set a category limit to TRACE like this:

<category name="com.mydomain">
<priority value="TRACE"/>
</category>

But under my appender I have this threshold:

<param name="Threshold" value="DEBUG"/>

Will I still have the performance hit of my TRACE statements going through the logger routines but just not being printed? In other words, would it be less load if I set my category to DEBUG like:

<category name="com.mydomain">
<priority value="DEBUG"/>
</category>


The downside of this is that if I ask my customer to enable TRACE, they would have to change it in two places. But if it's a big performance hit, then we'll consider it.

Thank you!
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The documentation for log4j addresses that issue specifically. Read it here: http://logging.apache.org/log4j/1.2/manual.html and look at the section headed "Performance". Also bear in mind that it was written over a decade ago and any specific numbers mentioned apply to decade-old computers.
 
Acetylsalicylic acid is aspirin. This could be handy too:
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!