Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Java asynchronous logging

Posted on 2016-10-13
4
Medium Priority
?
105 Views
Last Modified: 2016-10-27
Hi Experts

Is there a logging tool such a log4j which does logging asynchronously? Or is there a wrapper to achieve this and how?
0
Comment
Question by:jw124210
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 41841685
What makes you think it's not asynchronous? I would think that log4j (though theoretically superseded by 'logback') already optimises performance with the use of threading. The initial call might be on the same thread but probably doesn't remain so in the implementation. Anything else would be
a. unnecessary as the performance gain would be vanishingly small
b. make the framework difficult to use
0
 
LVL 28

Accepted Solution

by:
dpearson earned 2000 total points
ID: 41842195
lo4j2 has both AsyncAppender and AsyncLogger classes - which use a separate thread to do the logging.

log4j (the earlier version) did not support those as far as I know.

Details are here:
https://logging.apache.org/log4j/2.x/manual/async.html

Doug
1
 

Author Closing Comment

by:jw124210
ID: 41863437
Thank you
0

Featured Post

Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question