LOGGING = {'version': 1, 'formatters': {'verbose': {'format':
    '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
    }, 'simple': {'format': '%(levelname)s %(message)s'}}, 'handlers': {
    'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler',
    'formatter': 'simple'}, 'file': {'level': 'DEBUG', 'class':
    'logging.FileHandler', 'filename': '/path/to/your/file.log',
    'formatter': 'simple'}}, 'loggers': {'django': {'handlers': ['file'],
    'level': 'DEBUG', 'propagate': True}}}
if DEBUG:
    pass
Python/Django: log to console under runserver, log to file under Apache