redlight/logging_module.py

16 lines
470 B
Python
Raw Normal View History

2023-08-17 11:12:07 -04:00
# logging_module.py
import logging
def configure_logger():
file_handler = logging.FileHandler('/var/log/matrix-synapse/redlight.log')
file_handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
file_handler.setFormatter(formatter)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(file_handler)
logger.propagate = False
return logger