Source: stackify.com

Laravel Logging Tutorial

Category: Database, Data, logging

Kim Sia September 17, 2021 Developer Tips, Tricks & ResourcesRegardless of what language and framework you use, proper logging is crucial to web development.

Knowing how to properly use logging frameworks is an essential part of creating high-quality software that is easy to debug.In this article, we will discuss in-depth coverage on Laravel, which is the most popular PHP framework in 2021.Fig Google Trends comparing popular PHP frameworksSpecifically, we will cover the following with respect to Laravel 8.0:The first four sections cover the basics of logging in Laravel.

In a later section, we will show how Monolog provides handlers that easily help you to send logs to these various destinations.

For the rest of the config/logging.php, the config file returns an associative array with two main keys — default and channels.Fig Default channel is usually stackDefault represents the default channel that any logging is sent to.

The point to remember is that when you want to use Monolog’s native handlers, then you want to use the Monolog driver.

Related Articles