Solved

Java asynchronous logging

Posted on 2016-10-13
4
59 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
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 26

Accepted Solution

by:
dpearson earned 500 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 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