1

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.

Anthon
  • 69,918
  • 32
  • 186
  • 246
ilan_pinto
  • 300
  • 1
  • 3
  • 14

1 Answers1

1

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.)

NinthTest
  • 128
  • 1
  • 8
  • 1
    I believe the problem is a missing logging configuration for the application. Here is a sample Docker image that demonstrates autologging.logged and autologging.traced emitting log entries using the default Docker log driver: https://hub.docker.com/r/mzipay/autologging-issue-1/ – NinthTest May 25 '16 at 02:48