How can I get the path to the log file for a given instance of the python logging object after calling getLogger()?
My python application sets-up logging in the main python script as follows.
import loggging
logging.basicConfig(
filename = '/path/to/log/file.log',
filemode = 'a',
format = '%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
datefmt = '%H:%M:%S',
level = logging.DEBUG
)
logging.info("===============================================================================")
logging.info( "Starting Application Logging" )
Then other scripts in the same app get that logging config with getLogger() as follows
import logging
logger = logging.getLogger( __name__ )
logger.info( "Logging Config Imported in Second Script" )
In the second script that only gets the logging config with getLogger(), I want to know the path to the log file.
How can I determine the full path to the log file after setting-up logging with getLogger()?