gpt4 book ai didi

php - Laravel 日志级别,有何不同?

转载 作者:可可西里 更新时间:2023-11-01 13:27:25 30 4
gpt4 key购买 nike

我可以在 Laravel 5.4 中看到几个日志选项,例如

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

我可以在 'log_level' => env('APP_LOG_LEVEL', 'debug'), 中将 app.php 中的日志级别更改为任何类型的级别想要。

但我想知道,有什么不同?选择关键,警报,紧急之一?

最佳答案

当您设置日志级别时,只有大于或等于设置级别的级别才会被记录。

可以引用laravel doc log-severity-levels ,

When using Monolog, log messages may have different levels of severity. By default, Laravel writes all log levels to storage. However, in your production environment, you may wish to configure the minimum severity that should be logged by adding the log_level option to your app.php configuration file.

Once this option has been configured, Laravel will log all levels greater than or equal to the specified severity. For example, a default log_level of error will log error, critical, alert, and emergency messages:

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

Monolog recognizes the following severity levels - from least severe to most severe: debug, info, notice, warning, error, critical, alert, emergency.

关于php - Laravel 日志级别,有何不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44819531/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com