makerspace / makeradmin

Stockholm Makerspace member administration and store.
https://docs.makeradmin.se/
21 stars 16 forks source link

How to hook into the python logging output? #320

Closed amrsoll closed 1 year ago

amrsoll commented 1 year ago

I can definitely the gunicorn traffic logs when running make dev.

However, it would be nice for me to access the logfiles created by the python logging library.

I see you configured the loggers to output to stderr which means it is difficult to access from outside.

Perhaps you use a nice equivalent to tail -f /var/log/my_logfile ?

emanuelen5 commented 1 year ago

Hi! We run the application in Docker containers. So you can reach the logs (that are printed to stdout) by running docker logs --tail <container-name>

amrsoll commented 1 year ago

Thank you @emanuelen5 :smile: that does provide me the stdout which I believe the running docker compose also provides? I believe I am unable to see stderr ?

emanuelen5 commented 1 year ago

I don't think stderr is treated differently (did a quick web search). I'm pretty sure it should also be printed to that output.

amrsoll commented 1 year ago

You are absolutely right, I had overlooked the lines I was logging