Skip to content

Commit 7c2f1c7

Browse files
authored
Merge pull request #12 from lengqiuqiuqiu/main
增加日志通道配置
2 parents 6a534e5 + 4983c7d commit 7c2f1c7

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/Middleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function process(Request $request, callable $next): Response
152152
$logs .= "[Redis]\t[connection:{$name}] ..." . PHP_EOL;
153153
}
154154

155-
call_user_func([Log::class, $method], $logs);
155+
call_user_func([Log::channel(config('plugin.webman.log.app.channel', 'default')), $method], $logs);
156156

157157
if ($has_uncommitted_transaction) {
158158
throw new RuntimeException('Uncommitted transactions found');

src/config/plugin/webman/log/app.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010
]
1111
],
1212
'dontReport' => [
13-
'app' => [
14-
],
15-
'controller' => [
16-
],
17-
'action' => [
18-
],
19-
'path' => [
20-
]
21-
]
13+
'app' => [],
14+
'controller' => [],
15+
'action' => [],
16+
'path' => []
17+
],
18+
'channel' => 'default' // 日志通道(在config/log.php里配置,默认是default)
2219
];

0 commit comments

Comments
 (0)