[ 
https://issues.apache.org/jira/browse/LOG4J2-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655630#comment-16655630
 ] 

Matt Sicker commented on LOG4J2-2479:
-------------------------------------

Simplest answer: asynchronous logging has the tradeoff that under system load, 
it's possible to drop log messages (or configure it to block, or other 
options). The safer way of logging is synchronously which also prevents log 
messages from being lost during errant times.

For example, if you were making an audit log of user actions in your 
application, you wouldn't want that to stop just because the system is 
overloaded.

> why async logging is not default setting in log4j2
> --------------------------------------------------
>
>                 Key: LOG4J2-2479
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2479
>             Project: Log4j 2
>          Issue Type: Question
>          Components: API
>    Affects Versions: 2.11.1
>            Reporter: Ruofan Shen
>            Priority: Minor
>              Labels: newbie
>
> Sorry I'm a green-hand here and trying to seeking answers for this question. 
> Please let me know if my question doesn't meet the courtesy, thanks!
> As the document indicates 
> (https://logging.apache.org/log4j/2.x/performance.html#benchmarks), async 
> logger is almost 12 times faster than the synchronized one(also testified on 
> my laptop), so what's the meaning of Log4j 2's still keeping synchronized log 
> as its default setting? Is there any limitation for async logging being 
> wildly separated in applications? Can I have any more specific examples for 
> it? Thanks!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to