[
https://issues.apache.org/jira/browse/LOG4J2-2374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16544572#comment-16544572
]
Ralph Goers commented on LOG4J2-2374:
-------------------------------------
Because locking a "rolling" file has problems locking a file that doesn't move
doesn't have. While the patch you provided may seem to work it will give the
illusion that a rolling file appender is safe to use across multiple JVMs. It
is not. If you have multiple applications all configured to roll the file at
the same time how do you make sure only one wins? If it is size-based the same
thing can happen. Just because you can make file I/O safe (which I am not
completely sure it will be if you try to rename or compress a file that is
being written to by another JVM) doesn't mean the whole rolling file scenario
is safe.
This can't be safely implemented without a ton of crap.
> Add RollingFileAppender locking option
> --------------------------------------
>
> Key: LOG4J2-2374
> URL: https://issues.apache.org/jira/browse/LOG4J2-2374
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core
> Reporter: Gary Gregory
> Assignee: Gary Gregory
> Priority: Major
> Fix For: 3.0.0, 2.11.1
>
> Attachments: logging-log4j2-rfa-locking.patch
>
>
> Support {{RollingFileAppender}} with {{locking="true"}}, currently it is hard
> coded to false internally.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)