mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-03 15:28:35 +00:00
add support for maximum log size, and max number of log files
Signed-off-by: wlan0 <sidharthamn@gmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ The `docker logs --follow` command will continue streaming the new output from
|
||||
the container's `STDOUT` and `STDERR`.
|
||||
|
||||
Passing a negative number or a non-integer to `--tail` is invalid and the
|
||||
value is set to `all` in that case. This behavior may change in the future.
|
||||
value is set to `latest` in that case.
|
||||
|
||||
The `docker logs --timestamp` commands will add an RFC3339Nano
|
||||
timestamp, for example `2014-09-16T06:17:46.000000000Z`, to each
|
||||
|
||||
@@ -17,7 +17,7 @@ container's logging driver. The following options are supported:
|
||||
|
||||
| `none` | Disables any logging for the container. `docker logs` won't be available with this driver. |
|
||||
|-------------|-------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `json-file` | Default logging driver for Docker. Writes JSON messages to file. No logging options are supported for this driver. |
|
||||
| `json-file` | Default logging driver for Docker. Writes JSON messages to file. |
|
||||
| `syslog` | Syslog logging driver for Docker. Writes log messages to syslog. |
|
||||
| `journald` | Journald logging driver for Docker. Writes log messages to `journald`. |
|
||||
| `gelf` | Graylog Extended Log Format (GELF) logging driver for Docker. Writes log messages to a GELF endpoint likeGraylog or Logstash. |
|
||||
@@ -25,6 +25,20 @@ container's logging driver. The following options are supported:
|
||||
|
||||
The `docker logs`command is available only for the `json-file` logging driver.
|
||||
|
||||
### The json-file options
|
||||
|
||||
The following logging options are supported for the `json-file` logging driver:
|
||||
|
||||
--log-opt max-size=[0-9+][k|m|g]
|
||||
--log-opt max-file=[0-9+]
|
||||
|
||||
Logs that reach `max-size` are rolled over. You can set the size in kilobytes(k), megabytes(m), or gigabytes(g). eg `--log-opt max-size=50m`. If `max-size` is not set, then logs are not rolled over.
|
||||
|
||||
|
||||
`max-file` specifies the maximum number of files that a log is rolled over before being discarded. eg `--log-opt max-file=100`. If `max-size` is not set, then `max-file` is not honored.
|
||||
|
||||
If `max-size` and `max-file` are set, `docker logs` only returns the log lines from the newest log file.
|
||||
|
||||
### The syslog options
|
||||
|
||||
The following logging options are supported for the `syslog` logging driver:
|
||||
|
||||
Reference in New Issue
Block a user