joaodrp / gelf-formatter

GELF formatter for the Python standard library logging module.
MIT License
9 stars 4 forks source link

gelf-formatter induces logging error in django when uncaptured exception is raised #16

Closed 0mbi closed 3 years ago

0mbi commented 3 years ago

Problem: Despite the fact that exception should be captured, when doing so in a django request handler, gelf-formatter produces a logging error caused by

TypeError: Object of type WSGIRequest is not JSON serializable

Solution: This can be fixed by converting value to string for non json serialzable objects: log_record[_prefix(key)] = str(value)

joaodrp commented 3 years ago

@0mbi, do you want to create a PR for this?

joaodrp commented 3 years ago

Fixed with #18