简体   繁体   中英

Django mod_python logging issue

I'm using Django with mod_python on remote server and need to add some logging. I try to add some test log, in settings.py I add this code:

import logging

logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)s %(message)s', filename='/home/voip_maker/django.log', filemode='a+')

logging.debug("hello world!")
logging.info("this is some interesting info!")
logging.error("this is an error!")

Then I restart apache and try to open my project via web, but there are no changes in log file.

Can you please help me with this issue, how I must configure logging to get changes in log file.

Thanks very much,

Django has made logging even simpler. Please check the below docs:

https://docs.djangoproject.com/en/1.4/topics/logging/

All you need to do is to add a dictionary to settings.py file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM