Member-only story
PHP log levels and logging Tips
In this article, I want to talk about the log levels that exist in the PHP world and share with you some logging tips.
What are the benefits?
Typically, in a development environment, we normally use a debugger. It is the best choice for us to go step by step in the code.
But in other environments, like staging or production, we don’t have debuggers.
So what happens if we need to have some insight into what’s happening? The answer to this is logging.
Essentially logging helps us to know what’s happening in your application. It can help us to be more effective with troubleshooting and monitoring any problems.
But we should use the appropriate levels, for each type of message we want to log.
And why is that important?
Because if you don’t have any criteria, you will be flooded with information you can’t prioritize, and likely will give up using it.
You wouldn’t find useful for you, probably.