【黄啊码】使用think-queue产生大量日志文件怎么办?

有时候某些原因程序出错,会有大量日志生成,最好调整下日志,单独出来。在配置文件config/queue.php开头添加:

use think\facade\Log;
Log::init([
‘single’ => ‘queue’,
‘file_size’ => 1024 * 1024 * 10,
‘level’ => [‘error’],]);
日志将输出到runtime目录的queue-cli.log文件

这里能解决三个问题:

1、避免生成太多的日志文件,将日志文件大小尽量设置大一点

2、将记录日志的级别调成error的时候才记录

3、将queue日志独立开来,容易分辨

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:35a30d94-69f0-4da1-8b31-00dd331256fa

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:bdc73fbd-bef0-420a-aa62-6e195e3cecd2

try{
}catch (Exception $ex){
}

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:0284c435-e3e0-4501-b49f-6459fcab55f9

[En]

[TencentCloudSDKException] code:FailedOperation.ServiceIsolate message:service is stopped due to arrears, please recharge your account in Tencent Cloud requestId:ffda12a5-f8e8-45e3-a004-95028c4ddc4d

废话不多说,有问题,直接v信❤:ama-huangama

Original: https://www.cnblogs.com/huangama/p/15581550.html
Author: 黄啊码
Title: 【黄啊码】使用think-queue产生大量日志文件怎么办?

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/562267/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球