Member-only story

PHP log levels and logging Tips

Luís Nóbrega
4 min readJan 20, 2020

--

Photo by Angie Muldowney on Unsplash

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?

Photo by MARK ADRIANE on Unsplash

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.

What levels exist in PHP?

--

--

Luís Nóbrega
Luís Nóbrega

Written by Luís Nóbrega

Web Developer at 25friday. Likes to travel, write and being a father.

No responses yet