]> BookStack Code Mirror - bookstack/blob - app/Config/logging.php
Followed Laravel 9 update steps and file changes
[bookstack] / app / Config / logging.php
1 <?php
2
3 use Monolog\Formatter\LineFormatter;
4 use Monolog\Handler\ErrorLogHandler;
5 use Monolog\Handler\NullHandler;
6 use Monolog\Handler\StreamHandler;
7
8 /**
9  * Logging configuration options.
10  *
11  * Changes to these config files are not supported by BookStack and may break upon updates.
12  * Configuration should be altered via the `.env` file or environment variables.
13  * Do not edit this file unless you're happy to maintain any changes yourself.
14  */
15
16 return [
17
18     // Default Log Channel
19     // This option defines the default log channel that gets used when writing
20     // messages to the logs. The name specified in this option should match
21     // one of the channels defined in the "channels" configuration array.
22     'default' => env('LOG_CHANNEL', 'single'),
23
24     // Deprecations Log Channel
25     // This option controls the log channel that should be used to log warnings
26     // regarding deprecated PHP and library features. This allows you to get
27     // your application ready for upcoming major versions of dependencies.
28     'deprecations' => [
29         'channel' => 'null',
30         'trace' => false,
31     ],
32
33     // Log Channels
34     // Here you may configure the log channels for your application. Out of
35     // the box, Laravel uses the Monolog PHP logging library. This gives
36     // you a variety of powerful log handlers / formatters to utilize.
37     // Available Drivers: "single", "daily", "slack", "syslog",
38     //                    "errorlog", "monolog",
39     //                    "custom", "stack"
40     'channels' => [
41         'stack' => [
42             'driver'            => 'stack',
43             'channels'          => ['daily'],
44             'ignore_exceptions' => false,
45         ],
46
47         'single' => [
48             'driver' => 'single',
49             'path'   => storage_path('logs/laravel.log'),
50             'level'  => 'debug',
51             'days'   => 14,
52         ],
53
54         'daily' => [
55             'driver' => 'daily',
56             'path'   => storage_path('logs/laravel.log'),
57             'level'  => 'debug',
58             'days'   => 7,
59         ],
60
61         'stderr' => [
62             'driver'  => 'monolog',
63             'level'   => 'debug',
64             'handler' => StreamHandler::class,
65             'with'    => [
66                 'stream' => 'php://stderr',
67             ],
68         ],
69
70         'syslog' => [
71             'driver' => 'syslog',
72             'level'  => 'debug',
73         ],
74
75         'errorlog' => [
76             'driver' => 'errorlog',
77             'level'  => 'debug',
78         ],
79
80         // Custom errorlog implementation that logs out a plain,
81         // non-formatted message intended for the webserver log.
82         'errorlog_plain_webserver' => [
83             'driver'         => 'monolog',
84             'level'          => 'debug',
85             'handler'        => ErrorLogHandler::class,
86             'handler_with'   => [4],
87             'formatter'      => LineFormatter::class,
88             'formatter_with' => [
89                 'format' => '%message%',
90             ],
91         ],
92
93         'null' => [
94             'driver'  => 'monolog',
95             'handler' => NullHandler::class,
96         ],
97
98         // Testing channel
99         // Uses a shared testing instance during tests
100         // so that logs can be checked against.
101         'testing' => [
102             'driver' => 'testing',
103         ],
104
105         'emergency' => [
106             'path' => storage_path('logs/laravel.log'),
107         ],
108     ],
109
110     // Failed Login Message
111     // Allows a configurable message to be logged when a login request fails.
112     'failed_login' => [
113         'message' => env('LOG_FAILED_LOGIN_MESSAGE', null),
114         'channel' => env('LOG_FAILED_LOGIN_CHANNEL', 'errorlog_plain_webserver'),
115     ],
116
117 ];