-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Logback daily log rollover leads to main log file removed and .tmp file left behind #863
Comments
We found out that the gzip compression operation handled by logback was leading to the issues seen above, so we decided to disable it. Also, we decided to use AsyncAppender with higher buffer size to ensure none of the log events were dropped or partially written into the log file. The logback-spring.xml now looks like this
This change has helped us to have all log events written into log file without drop and the Size & Time based rollover is happening correctly. |
We have developed a reactive web application using Spring boot 2.7.18 that uses logback 1.2.13 along with Slf4j for logging. The application runs on linux server and generates application and access logs with a log rollover policy set to SizeAndTimeBasedRollingPolicy as described later.
When the application is put under load of thousands of requests per second, we have observed few issues with logging
The logback-spring.xml is as follows
The log directory ends up in a state like this
Here we expected logback to create the new file "appname-access.log" for the application to write into.
Having read a bit more on logback documentation around SizeAndTimeBasedRollingPolicy and suggestion to avoid using it unless absolutely needed, we decided to try TimeBasedRollingPolicy instead. However, with this change we still end up with the same set of issues.
We would like to understand the root cause for these issues to determine the best possible solution.
The text was updated successfully, but these errors were encountered: