madzak / python-json-logger

Json Formatter for the standard python logger
BSD 2-Clause "Simplified" License
1.7k stars 231 forks source link

How can I make warnings being JSON formatted? #109

Closed MartinThoma closed 1 year ago

MartinThoma commented 3 years ago

I still see this in my logs:

flask_sqlalchemy/__init__.py:834: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.

I guess this is not a log, but a warning. Can those also be json formatted?

janbuchar commented 3 years ago

Try logging.captureWarnings(True).