I am trying to use my python app on docker. I'm using a package called autologging
which is actually using python's logging
library.
When I use my app inside a docker container it prints out the sys prints but not the ones generated by the logger.
I have tried to define the following in the compose.yml
file and it's still not working:
stdin_open: True
tty: True
privileged: True
cap_add:
- "ALL"
environment:
- PYTHONUNBUFFERED=0
I also tried the -u
option.
The autologging module uses Python's standard logging module. As such, it is governed by the same configuration settings. If you are simply not seeing any log output, please make sure that you are configuring logging appropriately for the application. (I myself am not familiar with Docker; it may simply be the case that the root logger is by default suppressing the log entries.)
If you haven't explicitly configured logging for your application, please refer to the Python documentation here. If you have explicitly configured logging for your application, please provide details (there is an open issue to track this at https://github.com/mzipay/Autologging/issues/1).
(Note: I am the author of autologging.)