hovel/imagestore — pull request #35 by topiaruss (2014-06-05 12:32:30+00:00)
Title: Add logging on IOError for Image and Album thumbnails

For sorl-thumbnail and imagestore it is not uncommon to have issues with file handling, media paths, etc.

On my installation I setup a logging handler by adding the following at the end of settings.py. I don't know if this is essential. :

LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format' : "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
'datefmt' : "%d/%b/%Y %H:%M:%S"
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(LOG_DIR, 'mysite.log'),
'formatter': 'verbose'
},
'imagestore_file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(LOG_DIR, 'imagestore.log'),
'formatter': 'verbose'
},
},
'loggers': {
'django': {
'handlers':['file'],
'propagate': True,
'level':'DEBUG',
},
'imagestore': {
'handlers':['imagestore_file'],
'propagate': True,
'level':'DEBUG',
},
}
}