Files
podman/cmd
prabhat-kumar96 385f0905e9 log: expose conmon log rotation options through REST API and CLI
As of conmon 2.2.0, conmon supports log file rotation via --log-rotate
and --log-max-files. This commit exposes those options through Podman's
REST API, specgen model, CLI (--log-opt), and libpod container runtime
so that users managing containers through the API can configure conmon
log rotation settings.

New --log-opt keys accepted:
  max-file=<n>               Maximum number of rotated log backup files.
                             Setting this implicitly enables log rotation.
  log-rotate=true|false      Explicitly enable or disable log rotation.

Options flow:
  CLI / REST API
    -> specgenutil parses and validates new opts
    -> specgen.LogConfig.Options carries max-file and log-rotate
    -> generate.MakeContainerFromSpec calls WithLogMaxFiles/WithLogRotate
    -> libpod stores LogMaxFiles and LogRotate in ContainerConfig
    -> oci_conmon_common.go passes --log-max-files/--log-rotate to conmon

podman inspect now reflects rotation settings in HostConfig.LogConfig.Config.

Fixes: https://github.com/containers/podman/issues/29543
Signed-off-by: prabhat-kumar96 <prabhatmathur9927@gmail.com>
2026-10-24 15:44:16 +05:30
..