Verified Commit be7b8e9c authored by Peter Stanko's avatar Peter Stanko
Browse files

Reneabled loggers again to log actions

parent 5217d57d
Pipeline #31627 passed with stage
in 7 minutes and 46 seconds
......@@ -8,8 +8,6 @@ from logging.config import dictConfig
from dotenv import load_dotenv
from portal.tools import paths
load_dotenv()
......@@ -108,10 +106,9 @@ class Logging:
'level': self.global_log_level,
'propagate': True
},
'werkzeug ': {
'werkzeug': {
'handlers': ['flask_file'],
'level': 'ERROR', 'propagate': True,
'disabled': True,
'level': 'ERROR', 'disabled': True,
},
'git': {
'handlers': ['console', 'storage_file'],
......@@ -131,22 +128,26 @@ class Logging:
@property
def config(self):
loggers = self.loggers
handlers = self.handlers
return {
'version': 1,
'disable_existing_loggers': False,
'formatters': self.formatters,
'handlers': self.handlers,
'handlers': handlers,
'loggers': loggers,
}
def get_logger_file(self, name, level: str = None):
level = level or self.file_log_level
from portal.tools import paths
filename = str(paths.LOG_DIR / f'{name}.log')
return {
'level': level,
'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'verbose',
'filename': str(paths.LOG_DIR / f'{name}.log'),
'filename': filename,
'maxBytes': 5000000, # 5MB
'backupCount': 5
}
......@@ -168,10 +169,10 @@ class Logging:
self.reenable_loggers()
def reenable_loggers(self):
# loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
# for logger in loggers:
# self.log.info(f"Enabling logger: {logger.name}")
# logger.disabled = False
loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
for logger in loggers:
self.log.info(f"Enabling logger: {logger.name}")
logger.disabled = False
pass
......
......@@ -5,7 +5,6 @@ from pathlib import Path
from git import Repo
log = logging.getLogger(__name__)
log.disabled = False
def git_clone(entity, **kwargs):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment