How to save log files from docker container?

I have a weblogic container running on a docker machine (which runs on Windows 7 using the docker toolbar) and you want to automatically save logs from the container to the Windows machine.

I know I can use the command docker cp, but instead of writing logs to the Windows machine every time, is there a better way to save the logs from the container to a folder on the Windows computer?

+4
source share
1 answer

See “ Docker Strategies,” which illustrates the various methods. The
recommended file is registered using the Docker Logging Driver .
See More in Configuring Logging Drivers .

As shown in “ More Effective Ways to Handle Logging in Containers, ” you can link the log folder to the host folder through a data volume container .

# docker run -ti -v /dev/log:/dev/log fedora sh
+6
source

Source: https://habr.com/ru/post/1672198/


All Articles