forked from karlomikus/multilog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multilog.php
39 lines (36 loc) · 1.24 KB
/
multilog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use Monolog\Handler\RotatingFileHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
/*
|--------------------------------------------------------------------------
| Multilog
|--------------------------------------------------------------------------
|
| Configure your log streams here
|
*/
return [
// Uncomment to proxy Log::foo() to Multilog::channel('app')->foo()
// 'defaultChannel' => 'app',
'channels' => [
// Usage: Multilog::channel('app')->info('Hello world')
'app' => function ($channel) {
$logger = new Logger($channel);
$logger->pushHandler(new RotatingFileHandler(
storage_path('/logs/app.log'),
7,
Logger::INFO
));
return $logger;
},
// Wildcard configuration for any channel starting with "industries.":
// Usage: Multilog::channel('industries.acme')->info('Hello world')
// Multilog::channel('industries.wayne')->info('Foo bar')
'industries.*' => function ($channel) {
$logger = new Logger($channel);
$logger->pushHandler(new StreamHandler(storage_path('/logs/' . $channel . '.log')));
return $logger;
},
],
];