Laravel log level, how is it different?

I see multiple log options in Laravel 5.4 such as

Log::emergency($message);
Log::alert($message);
Log::critical($message);
Log::error($message);
Log::warning($message);
Log::notice($message);
Log::info($message);
Log::debug($message);

      

And I can change the log level app.php

at 'log_level' => env('APP_LOG_LEVEL', 'debug'),

any level that I want.

But I was wondering what is different? Which log was hacked when one of the selected critical, alert, emergency

?

+6


source to share


1 answer


When you set the log level, only a level greater than or equal to the set level will be logged.

You can reference the laravel doc log severity level ,



When using Monologue, log messages can have different severity levels. By default, Laravel writes all log levels to the repository. However, in a production environment, you can customize the minimum severity that should be logged by adding the log_level option to the app.php configuration file.

Once this setting is configured, Laravel will log all levels greater than or equal to the specified severity. For example, by default error log_level will log error, critical, warning and alarm messages:

'log_level' => env('APP_LOG_LEVEL', 'error'),

      

Monologue recognizes the following severity levels, from least severe to most severe: Debug, Info, Notification, Warning, Error, Critical, Warning, Emergency.

+2


source







All Articles