I'm trying to understand how logfiles work with the Python 2 logging module.
I know that I can save the log output to a text file using something like:
logging.basicConfig(filename='example.log',level=logging.DEBUG)
It's not clear to me from the documentation on:
- Whether or not absolute
filenamepaths are valid - The proper syntax for specifying relative paths (assuming that
../example.logis valid).
If I execute this script from /home/bob, how do I specify that I want the logfile saved to the /tmp directory instead - using both absolute and relative paths?
Is logging.basicConfig(filename='../../tmp/example.log') valid?
Similarly, is logging.basicConfig(filename='/tmp/example.log') valid?