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

Use RollingFileAppender only when log_limit_in_kbytes greater than 0 #1228

Merged
merged 2 commits into from
May 4, 2023

Conversation

jtduffy
Copy link
Contributor

@jtduffy jtduffy commented May 1, 2023

This corrects the agent logger agent config so that a RollingFileAppender is only created if the setting log_limit_in_kbytes is > 0. Before, if the log_limit_in_kbytes was 0 but log_file_count was > 1, a RollingFileAppender was created, but with a NoOp trigger policy, no rolling ever actually occurred.

Created unit tests for these scenarios.

The docs will be clarified with the follow info:

  • if log_daily is true, it will use the file_count value, with a minimum value of 1; if log_limit_in_kbytes > 0, a composite trigger policy will be configured: daily roll and size based roll
  • if log_limit_in_kbytes > 0, a rolling file appender strategy will be configured, using the configured log_file_count (minimum of 1)
  • Otherwise, no log rolling strategy will be configured

This is a non-breaking change, since any environment with log_limit_in_kbytes == 0 and log_file_limit > 1 will result in a regular, non-rolling file appender, which is equivalent to prior behavior.

@jtduffy jtduffy merged commit ba2d04c into main May 4, 2023
@jtduffy jtduffy deleted the NR-112329-rolling-logfile-update branch May 4, 2023 12:25
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