3 ms·
If you drill through the docker source code, it becomes apparent that their are some rather serious issues to doing something other then this. I really really
by XorNot 11y ago
If you drill through the docker source code, it becomes apparent that their are some rather serious issues to doing something other then this.
I really really want a LOG directive for docker where I can just setup some pipes which the daemon will collect and tag into it's log files (would make dealing with old Java processes a lot easier).
But actually finding somewhere to hook this logic in - huge task. A lot harder then grabbing stdout/stderr of the init process in the container.
- stephenr 11y agoThe whole point of getting logs out of containers is to centralise and store them somehow. This exact job is what Syslog (over a network) does.
- Gigablah 11y agoYou can use different logging drivers: https://docs.docker.com/engine/admin/logging/overview/ https://docs.docker.com/engine/admin/logging/overview/
- ibotty 11y agoThat does not answer the question on how to capture _different_ application logs.
- elbear 11y agoWhy not have the application log to a file on a data container?
- DanielDent 11y agoWell, now you've just created a new problem to deal with...
- lisivka 11y agoWho will manage these volumes, directories and log files? Why not just use existing infrastructure? I use containers for 10 years (they are called VServer), and I newer had a problem with standard setup: some less important logs are stored directly in container and rotated with logrotate, some more important logs (and error messages from less important logs) are forwarded to central server for analyzing, some are just disabled or discarded.
- DanielDent 11y agoI'm a heavy docker (ab)user, but I haven't gone through the source code - i.e. perhaps there is some complexity I'm overlooking. But couldn't Docker provide additional file handles for extra logging streams? Programs which understand they live in a Docker world could hook into an special system call directly. Non-Docker-Logging-Enabled apps could have a helper program (conceptually similar to 'ip netns exec') remap STDOUT & STDERR.