Skip to content

Commit 80645b3

Browse files
committed
日志格式
1 parent 274cb78 commit 80645b3

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

src/config.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,29 @@
2424
*/
2525
'use_laravel_cache' => true,
2626

27-
/*
27+
/**
2828
* 日志配置
2929
*
30-
* level: 日志级别可选为:
31-
* debug/info/notice/warning/error/critical/alert/emergency
32-
* file:日志文件位置(绝对路径!!!),要求可写权限
30+
* level: 日志级别, 可选为:
31+
* debug/info/notice/warning/error/critical/alert/emergency
32+
* path:日志文件位置(绝对路径!!!),要求可写权限
3333
*/
34-
'log' => [
35-
'level' => env('WECHAT_LOG_LEVEL', 'debug'),
36-
'file' => env('WECHAT_LOG_FILE', storage_path('logs/wechat.log')),
34+
'log' => [
35+
'default' => env('APP_DEBUG', false) ? 'dev' : 'prod', // 默认使用的 channel,生产环境可以改为下面的 prod
36+
'channels' => [
37+
// 测试环境
38+
'dev' => [
39+
'driver' => 'single',
40+
'path' => '/tmp/easywechat.log',
41+
'level' => 'debug',
42+
],
43+
// 生产环境
44+
'prod' => [
45+
'driver' => 'daily',
46+
'path' => '/tmp/easywechat.log',
47+
'level' => 'info',
48+
],
49+
],
3750
],
3851
],
3952

0 commit comments

Comments
 (0)