I am already using a basic logging config where all messages across all modules are stored in a single file. However, I need a more complex solution now:
- Two files: the first remains the same.
- The second file should have some custom format.
I have been reading the docs for the module, bu they are very complex for me at the moment. Loggers, handlers...
So, in short:
How to log to two files in Python 3, ie:
import logging
# ...
logging.file1.info('Write this to file 1')
logging.file2.info('Write this to file 2')
logging.WARNING
, so it would be more clear ifLogger.setLevel(logging.WARNING)
is called. – Archie