Skip to content
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

fix: allow RollingFileAppender to always run #280

Merged
merged 28 commits into from
Nov 6, 2022
Merged

fix: allow RollingFileAppender to always run #280

merged 28 commits into from
Nov 6, 2022

Conversation

tony19
Copy link
Owner

@tony19 tony19 commented Nov 6, 2022

Description

Changes:

  • Fix bug where RollingFileAppender doesn't always rollover logs
  • Various code clean-up
  • Remove deprecated java.util.logging support (JULHelper)

tony19 and others added 28 commits November 5, 2022 22:06
A permission exception (e.g., from the user not granting permission
in SDK 23+) causes `<property file="">` to result in a FileNotFound
exception with an inner "permission denied" error, but this is hidden
in the logs. This patch adds the exception to the log to help
troubleshoot the problem.
 * When using assets/logback.xml, main URL to watch was not set
   because an input stream was passed to GenericConfigurator
   instead of a URL. Without a main URL, reconfigure-on-change
   was disabled. This patch gets the assets resource as a
   URL instead to allow the reconfigure-on-change to proceed.

 * Special props were missing from the reconfiguration because
   the context was reset beforehand, but the special props were
   not reinserted into the context. This patch performs the
   necessary setup.
InvocationGate was originally added to improve performance in
scenarios of high frequency logging, as the rollover-condition
check (file size for SizeBasedTriggeringPolicy) could be
relatively expensive especially for large files. The "gate"
effectively ignored some logging/rollover events that occurred
close together in time.

However, this feature causes data loss from the ignored logging
events and oversized active log files from missed rollover events.

The feature itself seems like a bandaid for a larger performance
problem that should've been solved in a different manner, but it
ultimately caused worse problems. Thus, I'm removing InvocationGate
and allowing RollingFileAppender and its triggers to run freely.
@tony19 tony19 added this to the 2.0.1 milestone Nov 6, 2022
@tony19 tony19 merged commit 07c6bcd into main Nov 6, 2022
@tony19 tony19 deleted the wip/2.0.1 branch November 6, 2022 04:06
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