Docker Observability
Container log rotation
Configure json-file rotation by nominal file size and count; local driver rotates by default. Size budgets do not guarantee retention duration. Nominal file budget does not guarantee retention duration or host disk quota.
Formal Syntax & Structure
docker syntaxdocker
--log-opt max-size=SIZE --log-opt max-file=NWorking Example
Example Snippetdocker
--log-driver=json-file --log-opt max-size=10m --log-opt max-file=3