Using handlers
When dealing with performance, it is important to define the trade-off you want in terms of logging. An interesting metric can be to compare the application without any active logging statement versus the ones you want to keep (for production). If you identify that the performance drastically decreases with logging activated, then you probably have a configuration issue, either in one of the logging layers or—more commonly—with the backend usage (such as overusing a remote database).
The handler, being the part exiting the application, is the one requiring most of the attention. This doesn't mean other layers are not important, but they are generally faster to check since they often lead to a constant evaluation time.
There ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access