Skip to content

fix: allow RollingFileAppender to always run - #280

Merged
tony19 merged 28 commits into
mainfrom
wip/2.0.1
Nov 6, 2022
Merged

tony19 merged 28 commits into
mainfrom
wip/2.0.1

Conversation

@tony19

@tony19 tony19 commented Nov 6, 2022 •

Copy link
Copy Markdown
Owner

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.

2 participants