1. Are the common Dailyrollingfileappender and rollingfileappender synchronized?
1.1 Code Analysis
2. What is asynchronous Appender provided by the log4j 1.2.x? Asyncappender
2.1 Asyncappender Configuration
2.2 Asyncappender Analysis
3. log4j 2.x asynchronous log problem solution and analysis
3.1 log4j 2.x asynchronous log problem solutions
3.2 log4j 2.x high performance key for asynchronous logs
1. Are the common Dailyrollingfileappender and rollingfileappender synchronized? 1.1 Code Analysis
Dailyrollingfileappenderrollingfileappender Writerappender.append (loggingevent event) QuietWriter.write (String string)
Analysis of the code, the end relies on the Quietwriter write method, this method is synchronous.
So it's very clear that these two appender are not asynchronous.
2. What is asynchronous Appender provided by the log4j 1.2.x? AsyncAppender2.1 Asyncappender Configuration
Official explanation, Asyncappender must use the configuration in XML form
Important Note: The AsyncAppender
can only is script configured using the DOMConfigurator
.
Configuration examples
2.2 Asyncappender Analysis
3. log4j 2.x asynchronous log problem solution and Analysis 3.1 log4j 2.x solutions for asynchronous log problems 3.2 log4j 2.x asynchronous log high performance key
log4j Asynchronous Log Problem analysis