Skip to content

backport: fix: compress audit log archives on rollover [DHIS2-21620] - #25420

Merged
jason-p-pickering merged 1 commit into
2.43from
fix/rotate-audit-logs_2.43
Oct 7, 2026
Merged

jason-p-pickering merged 1 commit into
2.43from
fix/rotate-audit-logs_2.43

Conversation

@jason-p-pickering

Copy link
Copy Markdown
Contributor

The dhis-audit.log RollingFileAppender sets BEST_COMPRESSION but its
filePattern was "<file>.%i", which has no compression suffix. Log4j2
triggers archive compression solely via the filePattern suffix
(.gz/.zip); compressionLevel only selects the level when such a suffix
is present. As a result the configured compression never ran and, with
withFileIndex("nomax"), audit archives accumulated uncompressed and
unbounded -- filling the log directory (315 GB observed in production).

Add the .gz suffix so the already-configured BEST_COMPRESSION takes
effect and each midnight rollover produces a gzip-compressed archive.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

jason-p-pickering added a commit to jason-p-pickering/dhis2-core that referenced this pull request Oct 3, 2026
@jason-p-pickering
jason-p-pickering requested review from a team and stian-sandvold October 6, 2026 08:12
@jason-p-pickering
jason-p-pickering merged commit 2d2924d into 2.43 Oct 7, 2026
18 checks passed
@jason-p-pickering
jason-p-pickering deleted the fix/rotate-audit-logs_2.43 branch October 7, 2026 05:49
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