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>
14 lines
316 B
Python
14 lines
316 B
Python
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
|
|
)
|