I want to add created date, created user details(some basic details) in starting of each log file in python
def errorlog(cls, filename, level=logging.DEBUG):
file_handler = RotatingFileHandler(
os.path.join(BASE_DIR, name, filename),
maxBytes=100,
mode= write_mode,
backupCount=10,
)
file_handler.setFormatter(formatter)
if (logger.hasHandlers()):
logger.handlers.clear()
logger.addHandler(file_handler)
here I am getting the new log files but what I want is when a log file is created, I want to add some basic details as default like
#--------------------------#
# Created by : xxx
# Employee ID : xxx
# Date : xxxx
#--------------------------#
how can I do this