Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Django logging requests

$
0
0

I'm using django 1.11 in aws elastic beanstalk and I've been trying to get my app to log with no luck . . .

I have these in my settings.py

LOGGING_CONFIG = NoneLOGGING = {'version': 1,'disable_existing_loggers': False,'handlers': {'file': {'level': 'DEBUG','class': 'logging.FileHandler','filename': '/opt/python/current/app/staging.log',        },    },'loggers': {'': {'handlers': ['file'],'level': 'DEBUG','propagate': True,        },'django': {'handlers': ['file'],'level': 'DEBUG','propagate': True,        },'django.request': {'handlers': ['file'],'level': 'DEBUG','propagate': True,        },    },}import logging.configlogging.config.dictConfig(LOGGING)

then I try to call one of my API and expecting something would show up in the log but it didn't. I django.request logger supposed to automatically log all incoming request or do I have to create a middleware that does logger.debug('something')?

logging in django is a lot more complicated than I thought :(


Viewing all articles
Browse latest Browse all 23131

Trending Articles