Skip to content

Add drop log file rotation for container deployments#666

Merged
tbachman merged 1 commit intomasterfrom
droplog-rotation
Mar 12, 2026
Merged

Add drop log file rotation for container deployments#666
tbachman merged 1 commit intomasterfrom
droplog-rotation

Conversation

@maheshkurund
Copy link
Copy Markdown
Collaborator

When drop log redirect to a custom file is enabled via the OPFLEXAGENT_DROPLOG_FILE environment variable, the file grows unbounded as there is no rotation mechanism.

This patch adds a background logrotate-based rotation loop in the container launch script. A logrotate configuration is generated at startup and invoked every 12 hours.

The logrotate package is added to the container image in the Dockerfile.

New optional environment variables:

  • OPFLEXAGENT_DROPLOG_MAXSIZE: max file size in MB (default 50)
  • OPFLEXAGENT_DROPLOG_ROTATE: number of rotated backups (default 5)

When drop log redirect to a custom file is enabled via the
OPFLEXAGENT_DROPLOG_FILE environment variable, the file grows
unbounded as there is no rotation mechanism.

This patch adds a background logrotate-based rotation loop in the
container launch script. A logrotate configuration is generated at
startup and invoked every 12 hours.

The logrotate package is added to the container image in the
Dockerfile.

New optional environment variables:
- OPFLEXAGENT_DROPLOG_MAXSIZE: max file size in MB (default 50)
- OPFLEXAGENT_DROPLOG_ROTATE: number of rotated backups (default 5)
@tbachman tbachman merged commit cff1814 into master Mar 12, 2026
5 checks passed
@tbachman tbachman deleted the droplog-rotation branch March 12, 2026 12:59
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