Answers for "python logging how to luu file theo ngay"

0

python logging to syslog linux

import logging
import logging.handlers

my_logger = logging.getLogger('MyLogger')
my_logger.setLevel(logging.DEBUG)

handler = logging.handlers.SysLogHandler(address = '/dev/log')

my_logger.addHandler(handler)

my_logger.debug('this is debug')
my_logger.critical('this is critical')
Posted by: Guest on March-11-2021
0

python logging basicConfig+time

logging.basicConfig(filename='my_log_file.log', format='%(asctime)s - %(message)s', level=logging.INFO)
Posted by: Guest on December-07-2021

Code answers related to "python logging how to luu file theo ngay"

Python Answers by Framework

Browse Popular Code Answers by Language