Django prints production server information

I have some fingerprints in a debugging application. On the production server, where does this printed information go? in the apache log? I am using apache / mod_wsgi.

Thanks.

+6
source share
2 answers

Use logging

I like to write to a file sometimes, so I use the following in my .py settings

import logging logging.basicConfig( level = logging.INFO, format = '%(asctime)s %(levelname)s %(message)s', filename = '/tmp/djangoLog.log',) 

and where I want to keep a journal:

 import logging logging.info("Making the alpha-ldap connection"); 

then in /tmp/djangoLog.log I would see the line "Create alpha-ldap connection" e

+18
source

Mark this topic for some pointers: In Django, how do I let print operators work with Apache WSGI?

However, you should not use print instructions to debug your production system, especially since django comes with a nice flexible logging module that is currently included.

+2
source

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


All Articles