Thanks for this blog, it helps to understand how to do logging from Docker application. What I would like to learn in addition to what has been said — is how to programmatically (purely from Python code) direct logging output to a *specific* log file stored on a physical server.
Imagine a Docker container that runs *multiple* different scripts (or services), each one implemented as a separate Python program/module… These programs/services may be completely independent on each other, and therefore it is best to keep logging from each one separately from others. What’s more, it is extremely desirable (purely from maintenance/support/troubleshooting prospective) to have these logs stored on a physical server as files, with the date stamp to help find specific process’s logs on a given day (rotating log files).
I am interested to learn how to do *that* from a containerized (Docker) application… In other words, if my Docker container runs 3 services/scripts, I want to be able to store logs from those scripts as individual, date-rotating log files on a physical server — so that development team, or application support team (IT) can easily find these individual files on the server and analyze them in the event when some research/investigation/analysis/etc. needs to be performed, without seeing logging from the container itself and from any other script(s) in a container “polluting” the log and obstructing the investigation.
Please advise how to do that…