10000 Merge. by wilx · Pull Request #522 · log4cplus/log4cplus · GitHub
[go: up one dir, main page]

Skip to content

Merge. #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 15, 2021
Merged

Merge. #522

merged 6 commits into from
Aug 15, 2021

Conversation

wilx
Copy link
Contributor
@wilx wilx commented Aug 15, 2021

No description provided.

foxhlchen and others added 6 commits August 15, 2021 13:35
TimeBasedRollingFileAppender uses `filenamePattern` alone with
current date time as opened filename and `filename` field is left
empty almost all the time. This brings the problem when it calls
`append()` method from the base class FileAppenderBase.
The base class FileAppenderBase assumes that `filename` field is
the path for opened file. Now this contract is broken.

Currently, this will cause log4cplus to print
"log4cplus: ERROR file is not open:"
when `out` stream is broken. It's confusing and misleading.
Users may think that log4cplus tries to open a file with
the empty name "".

This does not stop here, as long as it persists, more
subtle bugs can be introduced.

This commit fixes this problem by setting filename to the
name of current opened file in
`TimeBasedRollingFileAppender::open()`
making the contract valid again.

Signed-off-by: foxhlchen <foxhlchen@gmail.com>
TimeBasedRollingFileAppender: Clear files before the MaxHistory when CleanHistoryOnStart false. log4cplus#381
@wilx wilx self-assigned this Aug 15, 2021
@wilx wilx merged commit 3565945 into log4cplus:master Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0