apache / apache/logging-log4j2

ConsoleAppender ignores immediateFlush, bufferedIo and bufferSize

Open
#4,262 6 comments 0 reactions 1 assignee Claimed by @abhinav-phi View on GitHub
appenders bug
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

`ConsoleAppender.Builder` inherits `immediateFlush`, `bufferedIo` and `bufferSize` from
`AbstractOutputStreamAppender.Builder`. `build()` reads none of them: the constructor hardcodes
`super(..., true, ...)`, and the manager is created through the `OutputStreamManager` constructor
that takes no buffer size, so it stays at `ENCODER_BYTE_BUFFER_SIZE`.

Configuration is parsed and bound, then dropped. Nothing warns. A `File` appender given the same
three attributes in the same config honours all three.

The docs document `bufferSize` and `immediateFlush` for Console (`manual/appenders.adoc`, L254 and
L307, same on `2.x` and `main`); `bufferedIo` is accepted but undocumented.

Not a regression — the hardcoded `true` predates 2.0; 2.7 (`2207cae2a1`) only made the attributes
inheritable. Reproduced identically on 2.24.1 → 2.26.1, 2.27.0-SNAPSHOT and 3.0.0-SNAPSHOT.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.