回答編集履歴

5

修正

2018/12/15 07:51

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -108,7 +108,7 @@
108
108
 
109
109
  'handler' => \Monolog\Handler\StreamHandler::class,
110
110
 
111
- 'formatter' => Hikaeme\Monolog\Formatter\LtsvFormatter::class,
111
+ 'formatter' => \Hikaeme\Monolog\Formatter\LtsvFormatter::class,
112
112
 
113
113
  'formatter_with' => [
114
114
 

4

修正

2018/12/15 07:51

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -106,7 +106,7 @@
106
106
 
107
107
  'driver' => 'monolog',
108
108
 
109
- 'handler' => Monolog\Handler\BrowserConsoleHandler::class,
109
+ 'handler' => \Monolog\Handler\StreamHandler::class,
110
110
 
111
111
  'formatter' => Hikaeme\Monolog\Formatter\LtsvFormatter::class,
112
112
 

3

修正

2018/12/15 07:51

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -14,22 +14,116 @@
14
14
 
15
15
 
16
16
 
17
+ #### .env
18
+
19
+
20
+
21
+ ```
22
+
23
+ LOG_CHANNEL=ltsv
24
+
25
+ ```
26
+
27
+
28
+
29
+ #### config/logging.php
30
+
31
+
32
+
17
33
  ```php
18
34
 
19
- 'ltsv' => [
35
+ <?php
20
36
 
21
- 'driver' => 'monolog',
22
37
 
23
- 'handler' => Monolog\Handler\BrowserConsoleHandler::class,
24
38
 
25
- 'formatter' => Hikaeme\Monolog\Formatter\LtsvFormatter,
39
+ return [
26
40
 
27
- 'formatter_with' => [
28
41
 
42
+
43
+ /*
44
+
45
+ |--------------------------------------------------------------------------
46
+
47
+ | Default Log Channel
48
+
49
+ |--------------------------------------------------------------------------
50
+
51
+ |
52
+
53
+ | This option defines the default log channel that gets used when writing
54
+
55
+ | messages to the logs. The name specified in this option should match
56
+
57
+ | one of the channels defined in the "channels" configuration array.
58
+
59
+ |
60
+
61
+ */
62
+
63
+
64
+
65
+ 'default' => env('LOG_CHANNEL', 'stack'),
66
+
67
+
68
+
69
+ /*
70
+
71
+ |--------------------------------------------------------------------------
72
+
73
+ | Log Channels
74
+
75
+ |--------------------------------------------------------------------------
76
+
77
+ |
78
+
79
+ | Here you may configure the log channels for your application. Out of
80
+
81
+ | the box, Laravel uses the Monolog PHP logging library. This gives
82
+
83
+ | you a variety of powerful log handlers / formatters to utilize.
84
+
85
+ |
86
+
87
+ | Available Drivers: "single", "daily", "slack", "syslog",
88
+
89
+ | "errorlog", "custom", "stack"
90
+
91
+ |
92
+
93
+ */
94
+
95
+
96
+
97
+ 'channels' => [
98
+
99
+
100
+
101
+ /* ... */
102
+
103
+
104
+
105
+ 'ltsv' => [
106
+
107
+ 'driver' => 'monolog',
108
+
109
+ 'handler' => Monolog\Handler\BrowserConsoleHandler::class,
110
+
111
+ 'formatter' => Hikaeme\Monolog\Formatter\LtsvFormatter::class,
112
+
113
+ 'formatter_with' => [
114
+
29
- 'dateFormat' => 'Y-m-d',
115
+ 'dateFormat' => 'Y-m-d',
116
+
117
+ ],
118
+
119
+ ],
120
+
121
+
30
122
 
31
123
  ],
32
124
 
125
+
126
+
33
- ],
127
+ ];
34
128
 
35
129
  ```

2

修正

2018/12/15 07:48

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
  ```php
18
18
 
19
- 'browser' => [
19
+ 'ltsv' => [
20
20
 
21
21
  'driver' => 'monolog',
22
22
 

1

設定例

2018/12/15 07:45

投稿

mpyw
mpyw

スコア5223

test CHANGED
@@ -11,3 +11,25 @@
11
11
 
12
12
 
13
13
  - [Logging - Laravel - The PHP Framework For Web Artisans](https://laravel.com/docs/5.7/logging)
14
+
15
+
16
+
17
+ ```php
18
+
19
+ 'browser' => [
20
+
21
+ 'driver' => 'monolog',
22
+
23
+ 'handler' => Monolog\Handler\BrowserConsoleHandler::class,
24
+
25
+ 'formatter' => Hikaeme\Monolog\Formatter\LtsvFormatter,
26
+
27
+ 'formatter_with' => [
28
+
29
+ 'dateFormat' => 'Y-m-d',
30
+
31
+ ],
32
+
33
+ ],
34
+
35
+ ```