Logger for worker

This commit is contained in:
Luciano Gervasoni
2025-07-15 16:51:22 +02:00
parent 06ded0b37d
commit b9ba0d8f3d
2 changed files with 6 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ logging.basicConfig(format='%(filename)s | PPID=%(ppid)s | %(levelname)s | %(asc
logger = logging.getLogger("fetcher")
# logger.setFormatter(logging.Formatter('%(levelname)s | PPID=%(ppid)s | %(asctime)s | %(message)s'))
logger.addFilter(PPIDFilter())
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
# To file log: DEBUG / INFO / WARNING / ERROR / CRITICAL
fh = logging.handlers.RotatingFileHandler(filename=os.path.join(logs_directory, "debug.log"), mode="a", maxBytes=10000000, backupCount=1)