]> BookStack Code Mirror - bookstack/blob - app/Config/logging.php
Merge branch 'footer-links' of git://github.com/james-geiger/BookStack into james...
[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     // Log Channels
25     // Here you may configure the log channels for your application. Out of
26     // the box, Laravel uses the Monolog PHP logging library. This gives
27     // you a variety of powerful log handlers / formatters to utilize.
28     // Available Drivers: "single", "daily", "slack", "syslog",
29     //                    "errorlog", "monolog",
30     //                    "custom", "stack"
31     'channels' => [
32         'stack' => [
33             'driver' => 'stack',
34             'channels' => ['daily'],
35             'ignore_exceptions' => false,
36         ],
37
38         'single' => [
39             'driver' => 'single',
40             'path' => storage_path('logs/laravel.log'),
41             'level' => 'debug',
42             'days' => 14,
43         ],
44
45         'daily' => [
46             'driver' => 'daily',
47             'path' => storage_path('logs/laravel.log'),
48             'level' => 'debug',
49             'days' => 7,
50         ],
51
52         'slack' => [
53             'driver' => 'slack',
54             'url' => env('LOG_SLACK_WEBHOOK_URL'),
55             'username' => 'Laravel Log',
56             'emoji' => ':boom:',
57             'level' => 'critical',
58         ],
59
60         'stderr' => [
61             'driver' => 'monolog',
62             'handler' => StreamHandler::class,
63             'with' => [
64                 'stream' => 'php://stderr',
65             ],
66         ],
67
68         'syslog' => [
69             'driver' => 'syslog',
70             'level' => 'debug',
71         ],
72
73         'errorlog' => [
74             'driver' => 'errorlog',
75             'level' => 'debug',
76         ],
77
78         // Custom errorlog implementation that logs out a plain,
79         // non-formatted message intended for the webserver log.
80         'errorlog_plain_webserver' => [
81             'driver' => 'monolog',
82             'level' => 'debug',
83             'handler' => ErrorLogHandler::class,
84             'handler_with' => [4],
85             'formatter' => LineFormatter::class,
86             'formatter_with' => [
87                 'format' => "%message%",
88             ],
89         ],
90
91         'null' => [
92             'driver' => 'monolog',
93             'handler' => NullHandler::class,
94         ],
95
96         // Testing channel
97         // Uses a shared testing instance during tests
98         // so that logs can be checked against.
99         'testing' => [
100             'driver' => 'testing',
101         ],
102     ],
103
104
105     // Failed Login Message
106     // Allows a configurable message to be logged when a login request fails.
107     'failed_login' => [
108         'message' => env('LOG_FAILED_LOGIN_MESSAGE', null),
109         'channel' => env('LOG_FAILED_LOGIN_CHANNEL', 'errorlog_plain_webserver'),
110     ],
111
112 ];