davide cucurnia
2024-01-30 55f8f925bdc15e7910d0c6824030f5e4584bae42
commit | author | age
9f6455 1 <?php
DC 2
3 use Monolog\Handler\NullHandler;
4 use Monolog\Handler\StreamHandler;
5 use Monolog\Handler\SyslogUdpHandler;
6
7 return [
8
9     /*
10     |--------------------------------------------------------------------------
11     | Default Log Channel
12     |--------------------------------------------------------------------------
13     |
14     | This option defines the default log channel that gets used when writing
15     | messages to the logs. The name specified in this option should match
16     | one of the channels defined in the "channels" configuration array.
17     |
18     */
19
20     'default' => env('LOG_CHANNEL', 'stack'),
21
22     /*
23     |--------------------------------------------------------------------------
24     | Deprecations Log Channel
25     |--------------------------------------------------------------------------
26     |
27     | This option controls the log channel that should be used to log warnings
28     | regarding deprecated PHP and library features. This allows you to get
29     | your application ready for upcoming major versions of dependencies.
30     |
31     */
32
33     'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
34
35     /*
36     |--------------------------------------------------------------------------
37     | Log Channels
38     |--------------------------------------------------------------------------
39     |
40     | Here you may configure the log channels for your application. Out of
41     | the box, Laravel uses the Monolog PHP logging library. This gives
42     | you a variety of powerful log handlers / formatters to utilize.
43     |
44     | Available Drivers: "single", "daily", "slack", "syslog",
45     |                    "errorlog", "monolog",
46     |                    "custom", "stack"
47     |
48     */
49
50     'channels' => [
51         'stack' => [
52             'driver' => 'stack',
53             'channels' => ['single'],
54             'ignore_exceptions' => false,
55         ],
56
57         'single' => [
58             'driver' => 'single',
59             'path' => storage_path('logs/laravel.log'),
60             'level' => env('LOG_LEVEL', 'debug'),
61         ],
62
63         'default' => [
64             'driver' => 'daily',
65             'path' => storage_path('logs/laravel.log'),
66             'level' => env('APP_LOG_LEVEL', 'debug'),
67             'days' => 15,
68         ],
69
70         'requests_failed' => [
71             'driver' => 'daily',
72             'path' => storage_path('logs/requests_KO.log'),
73             'level' => env('APP_LOG_LEVEL', 'debug'),
74             'days' => 15,
75         ],
76
77         'requests_managed' => [
78             'driver' => 'daily',
79             'path' => storage_path('logs/requests_OK.log'),
80             'level' => env('LOG_LEVEL', 'debug'),
81             'days' => 14,
82         ],
83
84         'daily' => [
85             'driver' => 'daily',
86             'path' => storage_path('logs/laravel.log'),
87             'level' => env('LOG_LEVEL', 'debug'),
88             'days' => 14,
89         ],
90
91         'slack' => [
92             'driver' => 'slack',
93             'url' => env('LOG_SLACK_WEBHOOK_URL'),
94             'username' => 'Laravel Log',
95             'emoji' => ':boom:',
96             'level' => env('LOG_LEVEL', 'critical'),
97         ],
98
99         'papertrail' => [
100             'driver' => 'monolog',
101             'level' => env('LOG_LEVEL', 'debug'),
102             'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
103             'handler_with' => [
104                 'host' => env('PAPERTRAIL_URL'),
105                 'port' => env('PAPERTRAIL_PORT'),
106                 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
107             ],
108         ],
109
110         'stderr' => [
111             'driver' => 'monolog',
112             'level' => env('LOG_LEVEL', 'debug'),
113             'handler' => StreamHandler::class,
114             'formatter' => env('LOG_STDERR_FORMATTER'),
115             'with' => [
116                 'stream' => 'php://stderr',
117             ],
118         ],
119
120         'syslog' => [
121             'driver' => 'syslog',
122             'level' => env('LOG_LEVEL', 'debug'),
123         ],
124
125         'errorlog' => [
126             'driver' => 'errorlog',
127             'level' => env('LOG_LEVEL', 'debug'),
128         ],
129
130         'null' => [
131             'driver' => 'monolog',
132             'handler' => NullHandler::class,
133         ],
134
135         'emergency' => [
136             'path' => storage_path('logs/laravel.log'),
137         ],
138     ],
139
140 ];