Add support for logging errors during in production mode.
Add COMMON_PRODUCTION_ERROR_LOG_PATH to control path of log file. Defaults to mayan/error.log. Add support logging request exceptions. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
13
mayan/apps/common/middleware/error_logging.py
Normal file
13
mayan/apps/common/middleware/error_logging.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ErrorLoggingMiddleware(object):
|
||||
def process_exception(self, request, exception):
|
||||
logger.exception(
|
||||
'Exception caught by request middleware; %s, %s', request,
|
||||
exception
|
||||
)
|
||||
Reference in New Issue
Block a user