You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Carter Kozak (Jira)" <ji...@apache.org> on 2021/01/05 23:54:00 UTC

[jira] [Commented] (LOG4J2-2991) Issue with log4j2.asyncLoggerWaitStrategy

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

Carter Kozak commented on LOG4J2-2991:
--------------------------------------

The properties for both fully async and config-based mixed async logging use different properties so they may be configured independently.

The we support both the new and old property scheme, but the first property name should be "log4j2.asyncLoggerConfigWaitStrategy" not "log4j2.asyncLoggerWaitStrategy" assuming you’re using mixed sync/async loggers.
Note that fully async logging via the AsyncLoggerContextSelector performs slightly better if you want everything to be async.

> Issue with log4j2.asyncLoggerWaitStrategy
> -----------------------------------------
>
>                 Key: LOG4J2-2991
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2991
>             Project: Log4j 2
>          Issue Type: Bug
>         Environment: Log4J 2.14.0
>  
> OpenJDK 64-Bit Server VM; 11.0.5; 11.0.5+10-LTS; mixed mode
> os.arch=amd64
> os.name.yjp=Windows 10
> os.name=Windows 10
> os.version.yjp=10.0.17134
> os.version=10.0
>            Reporter: Daniel Marques
>            Priority: Major
>
> The documentation ([https://logging.apache.org/log4j/2.x/manual/async.html#SysPropsAllAsync)] states that the property "log4j2.asyncLoggerWaitStrategy" can be used to control the waiting strategy used by the asynchronous logging system.
> However, setting/changing the property doesn't seem to have the desired effect.
> According to the documentation ([https://logging.apache.org/log4j/2.x/manual/configuration.html#SystemProperties)] "beginning in Log4j 2.10, all system property names have been normalized to follow a consistent naming scheme".  While "log4j2.asyncLoggerWaitStrategy" appears to be the normalized/consistent scheme, the system doesn't appear to recognize that. 
> The code ([https://github.com/apache/logging-log4j2/blob/d9e01a981b860aeb8834eac3eed201c686884b7a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigDisruptor.java#L218)] refers to a property named "AsyncLoggerConfig.WaitStrategy".  Setting that appears to have the desired effect.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)