Here is the logging settings that I am using.
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'standard': {
'format' : "[%(asctime)s] %(levelname)s [%(module)s:%(lineno)s] %(message)s",
'datefmt' : "%d/%b/%Y %H:%M:%S"
},
},
'handlers': {
'app_logger': {
'level':'DEBUG',
'class':'logging.handlers.TimedRotatingFileHandler',
'filename': '/var/log/django/app.log',
'backupCount': 5,
'when' : 'midnight',
'formatter': 'standard',
},
},
'loggers': {
'myproject': {
'handlers': ['app_logger'],
'level': 'INFO',
}
}
}
In my app I would like to be able to override the 'filename': '/var/log/django/another_app.log',
import logging<change log file to '/var/log/django/another_app.log'>
log = logging.getLogger('myproject')
log.info("Something here")
Any ideas?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment