I have an application deployed on Heroku and sometimes it throws the server error 500 randomly. I am trying to implement logging in my project. I am reading the docs but I am missing some critical piece of information. The docs say, Once you have configured your loggers, handlers, filters and formatters, you need to place logging calls into your code. My question is where exactly to put the logging code because I have already used try-except for all the parts, as far as I know, that may throw an error?
I have done a tutorial on the topic and reading the docs but that doesn't seem to convey the message to me.