miLibris / flask-rest-jsonapi

Flask extension to build REST APIs around JSONAPI 1.0 specification.
http://flask-rest-jsonapi.readthedocs.io
MIT License
597 stars 153 forks source link

Is there a hook to record logs when the status code is 500? #145

Open ShakeM opened 5 years ago

ShakeM commented 5 years ago

I am trying to record all 500 response in my production environment. Is there a way to record all of them without DEBUG = True ?

fgiraldi commented 5 years ago

I would like to see this alongside with a similar approach for JsonApiExceptions, since I can't find a way to log them. Would it be a good idea to make some sort of special parameter (maybe a configuration one, but different from DEBUG) in order to let the developers to raise or not to raise JsonApiExceptions? I mean, we could search for something like JSONAPI_EXCEPTIONS_RAISE with a default value of False, or some similar approach If I can help in anyway, please let me know. Nice work!