2

By using below mentioned code I am able to save the logging module output in current working directory.

But my aim is to save this output in some another directory i.e, what ever the directory i mentioned with the file name it has to be save in that directory with the specified file name without changing my current working directory.

import logging
LOG_FILENAME = 'example.log'
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.warning('%s before you %s', 'Look', 'leap!')

Please can anyone help me to solve this.

0 Answers0