Add COMMON_PRODUCTION_ERROR_LOGGING setting to control the logging of errors in production. Defaults to False. Change the error log file handle class to RotatingFileHandle to avoid an indefinitely growing log file.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-06-02 21:34:04 -04:00
parent 15badf4ff9
commit e2f95b4d48
3 changed files with 20 additions and 5 deletions

View File

@@ -55,6 +55,14 @@ setting_temporary_directory = namespace.add_setting(
),
is_path=True
)
setting_production_error_logging = namespace.add_setting(
global_name='COMMON_PRODUCTION_ERROR_LOGGING',
default=False,
help_text=_(
'Enable error logging outside of the system error logging '
'capabilities.'
)
)
setting_production_error_log_path = namespace.add_setting(
global_name='COMMON_PRODUCTION_ERROR_LOG_PATH',
default=os.path.join(settings.MEDIA_ROOT, 'error.log'), help_text=_(