I have an Azure app service and the container has a python file. i'm using the following code to generate the log file
now = datetime.now()
timestr = now.strftime("%Y%m%d")
logfile = 'log'+timestr
logHandler = RotatingFileHandler(filename=logfile, mode='a', maxBytes=10 * 1024 * 1024, backupCount=10)
logFormatter = logging.Formatter('[%(levelname)s]\t: %(asctime)s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
logHandler.setFormatter( logFormatter )
logger = logging.getLogger( 'MyLogger' )
logger.addHandler( logHandler )
However when i start the app service for the first time, it gives me a log file with the current date. But the file name does not update later. what needs to be done so that a new file is created according to the date.