O'Reilly logo

Mastering PHP 7 by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logging with Monolog

The PHP community provides several logging libraries for us to choose, such as Monolog, Analog, KLogger, Log4PHP, and others. Choosing the right library can be a daunting task. More so because we might decide to change the logging mechanism later on, which might leave us with a substantial amount of code to change. This is where the PSR-3 logging standard helps. Choosing a library that is standards-compliant makes it easier to reason with.

Monolog is one of the most popular PHP logging libraries. It is a free, MIT-licensed library that implements the PSR-3 logging standard. It allows us to easily sends our logs to files, sockets, inboxes, databases, and various web services.

We can easily install the Monolog library as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required