You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Volkan Yazici (Jira)" <ji...@apache.org> on 2021/09/20 07:22:00 UTC
[jira] [Closed] (LOG4J2-3162) Fix misleading documentation for
immediateFlush
[ https://issues.apache.org/jira/browse/LOG4J2-3162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Volkan Yazici closed LOG4J2-3162.
---------------------------------
Assignee: Volkan Yazici
> Fix misleading documentation for immediateFlush
> -----------------------------------------------
>
> Key: LOG4J2-3162
> URL: https://issues.apache.org/jira/browse/LOG4J2-3162
> Project: Log4j 2
> Issue Type: Documentation
> Components: Appenders
> Affects Versions: 2.14.1
> Reporter: Sharath Avadoot Gururaj
> Assignee: Volkan Yazici
> Priority: Minor
> Fix For: 3.0.0, 2.15.0
>
>
> In the documentation of [RollingFileAppender|https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender]
>
> {code:java}
> immediateFlush boolean When set to true - the default, each write will be followed by a flush. This will guarantee the data is written to disk but could impact performance.Flushing after every write is only useful when using this appender with synchronous loggers. Asynchronous loggers and appenders will automatically flush at the end of a batch of events, even if immediateFlush is set to false. This also guarantees the data is written to disk but is more efficient.
> {code}
> This is misleading. The appender does not really {{guarantee that the data is written to disk}} . All it does is [call|https://github.com/agsha/logging-log4j2/blob/1d56dac20d0827300a49a8cd9f0324185451757e/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/OutputStreamManager.java#L264] the underlying [OutputStream.flush()|https://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html#flush()]method, which does not guaratee that data is written to disk. It only guaratees that the data is handed over to the operating system
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)