In the logs, the timestamp is available but the "source file name"
and "line number"
are not logged with every log message.
How to log file name and line number in GAE Python logging.info
(or logging.warn
or logging.error
and others) ?
By "source file name"
, I mean the Python code file (*.py) which generated the log.
In your main.py
add:
formatter = logging.Formatter('%(levelname)-8s %(asctime)s %(filename)s:%(lineno)s] %(message)s')
logging.getLogger().handlers[0].setFormatter(formatter)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With