Skip to content

Commit acabdff

Browse files
committed
update log configuration file
1 parent 828967a commit acabdff

File tree

3 files changed

+59
-18
lines changed

3 files changed

+59
-18
lines changed

.env.example

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_LOG_LEVEL=debug
65
APP_URL=http://localhost
76

7+
LOG_CHANNEL=single
8+
89
DB_CONNECTION=mysql
910
DB_HOST=127.0.0.1
1011
DB_PORT=3306

config/app.php

-17
Original file line numberDiff line numberDiff line change
@@ -108,23 +108,6 @@
108108

109109
'cipher' => 'AES-256-CBC',
110110

111-
/*
112-
|--------------------------------------------------------------------------
113-
| Logging Configuration
114-
|--------------------------------------------------------------------------
115-
|
116-
| Here you may configure the log settings for your application. Out of
117-
| the box, Laravel uses the Monolog PHP logging library. This gives
118-
| you a variety of powerful log handlers / formatters to utilize.
119-
|
120-
| Available Settings: "single", "daily", "syslog", "errorlog"
121-
|
122-
*/
123-
124-
'log' => env('APP_LOG', 'single'),
125-
126-
'log_level' => env('APP_LOG_LEVEL', 'debug'),
127-
128111
/*
129112
|--------------------------------------------------------------------------
130113
| Autoloaded Service Providers

config/logging.php

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Default Log Channel
8+
|--------------------------------------------------------------------------
9+
|
10+
| This option defines the default log channel that gets used when writing
11+
| messages to the logs. The name specified in this option should match
12+
| one of the channels defined in the "channels" configuration array.
13+
|
14+
*/
15+
16+
'default' => env('LOG_CHANNEL', 'single'),
17+
18+
/*
19+
|--------------------------------------------------------------------------
20+
| Log Channels
21+
|--------------------------------------------------------------------------
22+
|
23+
| Here you may configure the log channels for your application. Out of
24+
| the box, Laravel uses the Monolog PHP logging library. This gives
25+
| you a variety of powerful log handlers / formatters to utilize.
26+
|
27+
| Available Drivers: "single", "daily", "syslog",
28+
| "errorlog", "custom"
29+
|
30+
*/
31+
32+
'channels' => [
33+
'single' => [
34+
'driver' => 'single',
35+
'path' => storage_path('logs/laravel.log'),
36+
'level' => 'debug',
37+
],
38+
39+
'daily' => [
40+
'driver' => 'daily',
41+
'path' => storage_path('logs/laravel.log'),
42+
'level' => 'debug',
43+
'days' => 7,
44+
],
45+
46+
'syslog' => [
47+
'driver' => 'syslog',
48+
'level' => 'debug',
49+
],
50+
51+
'errorlog' => [
52+
'driver' => 'errorlog',
53+
'level' => 'debug',
54+
],
55+
],
56+
57+
];

0 commit comments

Comments
 (0)