16 lines
470 B
Python
16 lines
470 B
Python
|
# 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
|