You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While dual-logging is enabled automatically, it is possible to disable
this feature, or to configure the default options. This patch adds
documentation for these options.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
| `cache-disabled` | `"false"` | Disable local caching. Boolean value passed as a string (`true`, `1`, `0`, or `false`). |
137
+
| `cache-max-size` | `"20m"` | The maximum size of the cache before it is rotated. A positive integer plus a modifier representing the unit of measure (`k`, `m`, or `g`). |
138
+
| `cache-max-file` | `"5"` | The maximum number of cache files that can be present. If rotating the logs creates excess files, the oldest file is removed. A positive integer. |
139
+
| `cache-compress` | `"true"` | Enable or disable compression of rotated log files. Boolean value passed as a string (`true`, `1`, `0`, or `false`). |
108
140
141
+
## Disable the dual logging cache
142
+
143
+
Use the `cache-disabled` option to disable the dual logging cache. Disabling the
144
+
cache can be useful to save storage space in situations where logs are only read
145
+
through a remote logging system, and if there is no need to read logs through
146
+
`docker logs` for debugging purposes.
147
+
148
+
Caching can be disabled for individual containers or by default for new containers,
149
+
when using the [daemon configuration file](/engine/reference/commandline/dockerd/#daemon-configuration-file).
150
+
151
+
The following example uses the daemon configuration file to use the ["splunk'](splunk.md)
152
+
logging driver as a default, with caching disabled:
153
+
154
+
```console
155
+
$ cat /etc/docker/daemon.json
156
+
{
157
+
"log-driver": "splunk",
158
+
"log-opts": {
159
+
"cache-disabled": "true",
160
+
... (options for "splunk" logging driver)
161
+
}
162
+
}
163
+
```
164
+
165
+
> **Note**
166
+
>
167
+
> For logging drivers that support reading logs, such as the `local`, `json-file`
168
+
> and `journald` drivers, dual logging is not used, and disabling the option has
169
+
> no effect.
109
170
110
171
## Limitations
111
172
112
-
- You cannot specify more than one log driver.
113
173
- If a container using a logging driver or plugin that sends logs remotely
114
174
suddenly has a "network" issue, no ‘write’ to the local cache occurs.
115
175
- If a write to `logdriver` fails for any reason (file system full, write
0 commit comments