FileAppender creates empty log files before any message is written
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start at the FileAppender initialization and write() entry point described in the issue, then trace how FileOutputStream is currently opened. Verify append mode preserves existing contents, non-append mode truncates as before, and that an appender which receives no message creates neither a file nor its parent directory.
Written by the indexing model from the issue text.
Description
Description
FileAppender currently opens its FileOutputStream during initialization. This creates the log file, and potentially its parent directory, even when no log message is ever written.
The file should be created only when the first message is logged. Existing behavior should otherwise be preserved:
- Append mode keeps existing contents.
- Non-append mode truncates an existing file so logging starts fresh.
- If no message is written, no new empty log file should be created.
The proposed fix is to open FileOutputStream lazily from write() instead of opening it during appender configuration.
- Dominant language
- C++
- Stars
- 302
- Forks
- 142
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 27
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/logging-log4cxx
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/logging-log4cxx#631 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
apache/logging-log4cxx#570 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/logging-log4cxx#557 · 7 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
apache/logging-log4cxx#494 · 5 comments ·
-
RFC5424 Support Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
apache/logging-log4cxx#390 · 1 comment ·
All issues in apache/logging-log4cxx
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·