patterndockerMinor
Keeping Docker logs only in memory
Viewed 0 times
keepinglogsdockermemoryonly
Problem
There are various log drivers available for Docker but it looks like all of them persist the logs to disk.
To reduce disk usage I would like to keep the logs only in memory (and limited to a certain size).
I could use log driver
Is this possible?
To reduce disk usage I would like to keep the logs only in memory (and limited to a certain size).
I could use log driver
none but I believe it immediately discards all log messages and sometimes it is still helpful to look at the currently produced logs without having to restart the container to switch to a different log driver.Is this possible?
Solution
One solution could be, I never tried, is to mount a memory filesystem (tmpfs) and let docker log to that directory with syslog
create a memory filesystem:
https://docs.oracle.com/cd/E18752_01/html/817-5093/fscreate-99040.html
let docker log with syslog:
https://www.simulmedia.com/blog/centralized-docker-logging-with-rsyslog
create a memory filesystem:
https://docs.oracle.com/cd/E18752_01/html/817-5093/fscreate-99040.html
let docker log with syslog:
https://www.simulmedia.com/blog/centralized-docker-logging-with-rsyslog
Context
StackExchange DevOps Q#17930, answer score: 1
Revisions (0)
No revisions yet.