From 1af8fe37672679f035b21f3a8dba371f09d1869e Mon Sep 17 00:00:00 2001 From: PCoder Date: Wed, 22 May 2024 21:50:52 +0530 Subject: [PATCH] Use RotatingFileHandler instead of ConcurrentLogHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Why? error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in ConcurrentLogHandler setup command: use_2to3 is invalid. [end of output] Looks like the module is incompatible with the latest setuptools. The recommended solution on the Internet seems to be to downgrade setuptools to 57.5.0 ;; however, this still does not solve the issue for my setup --- publichealth/settings/production.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/publichealth/settings/production.py b/publichealth/settings/production.py index 78f27dc..e46caee 100644 --- a/publichealth/settings/production.py +++ b/publichealth/settings/production.py @@ -1,6 +1,8 @@ +import logging import os import dj_database_url +from logging.handlers import RotatingFileHandler from .base import * # Do not set SECRET_KEY, Postgres or LDAP password or any other sensitive data here. @@ -194,7 +196,7 @@ if 'LOG_DIR' in env: # Public Health Schweiz log LOGGING['handlers']['publichealth_file'] = { 'level': 'INFO', - 'class': 'cloghandler.ConcurrentRotatingFileHandler', + 'class': 'logging.handlers.RotatingFileHandler', 'filename': os.path.join(env['LOG_DIR'], 'publichealth.log'), 'maxBytes': 5242880, # 5MB 'backupCount': 5 @@ -204,7 +206,7 @@ if 'LOG_DIR' in env: # Wagtail log LOGGING['handlers']['wagtail_file'] = { 'level': 'WARNING', - 'class': 'cloghandler.ConcurrentRotatingFileHandler', + 'class': 'logging.handlers.RotatingFileHandler', 'filename': os.path.join(env['LOG_DIR'], 'wagtail.log'), 'maxBytes': 5242880, # 5MB 'backupCount': 5 @@ -214,7 +216,7 @@ if 'LOG_DIR' in env: # Error log LOGGING['handlers']['errors_file'] = { 'level': 'ERROR', - 'class': 'cloghandler.ConcurrentRotatingFileHandler', + 'class': 'logging.handlers.RotatingFileHandler', 'filename': os.path.join(env['LOG_DIR'], 'error.log'), 'maxBytes': 5242880, # 5MB 'backupCount': 5