Skip to content

Commit

Permalink
LOG4J2-3114 - Enable immediate flush on RollingFileAppender when buff…
Browse files Browse the repository at this point in the history
…ered i/o is not enabled.
  • Loading branch information
rgoers committed Nov 21, 2021
1 parent 9f55c38 commit 5e5e598
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ isBufferedIo, policy, strategy, advertiseUri, layout, bufferSize, isImmediateFlu
manager.initialize();

return new RollingFileAppender(getName(), layout, getFilter(), manager, fileName, filePattern,
isIgnoreExceptions(), isImmediateFlush(), advertise ? getConfiguration().getAdvertiser() : null,
getPropertyArray());
isIgnoreExceptions(), !isBufferedIo || isImmediateFlush(),
advertise ? getConfiguration().getAdvertiser() : null, getPropertyArray());
}

public String getAdvertiseUri() {
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@
Improve PatternLayout performance by reducing unnecessary indirection and branching.
</action>
<!-- FIXES -->
<action issue="LOG4J2-3114" dev="rgoers" type="fix" due-to="Barnabas Bodnar">
Enable immediate flush on RollingFileAppender when buffered i/o is not enabled.
</action>
<action issue="LOG4J2-3168" dev="rgoers" type="fix" due-to="Benjamin Wöster">
Fix bug when file names contain regex characters.
</action>
Expand Down

0 comments on commit 5e5e598

Please sign in to comment.