File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,20 @@ public function report(Exception $e)
95
95
96
96
![ xiZhi] ( docs/xiZhi.jpg )
97
97
98
+ ## Extend custom channel
99
+
100
+ Modify the ` boot ` method in the ` app/Providers/AppServiceProvider.php ` file
101
+
102
+ ``` php
103
+ public function boot()
104
+ {
105
+ // Extend custom channel
106
+ \ExceptionNotifier::extend('YourChannel', function (\Illuminate\Contracts\Container\Container $container){
107
+ // return instance of the `\Guanguans\LaravelExceptionNotify\Contracts\Channel`.
108
+ });
109
+ }
110
+ ```
111
+
98
112
## Testing
99
113
100
114
``` bash
Original file line number Diff line number Diff line change @@ -97,6 +97,20 @@ public function report(Exception $e)
97
97
98
98
![ 息知] ( docs/xiZhi.jpg )
99
99
100
+ ## 扩展自定义通道
101
+
102
+ ` app/Providers/AppServiceProvider.php ` 的 ` boot ` 方法中添加
103
+
104
+ ``` php
105
+ public function boot()
106
+ {
107
+ // 扩展自定义通道
108
+ \ExceptionNotifier::extend('YourChannel', function (\Illuminate\Contracts\Container\Container $container){
109
+ // 返回 \Guanguans\LaravelExceptionNotify\Contracts\Channel 的实例
110
+ });
111
+ }
112
+ ```
113
+
100
114
## 测试
101
115
102
116
``` bash
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function collect()
33
33
'Method ' => $ this ->request ->method (),
34
34
'Action ' => optional ($ this ->request ->route ())->getActionName (),
35
35
'Duration ' => value (function () {
36
- $ startTime = defined ('LARAVEL_START ' ) ? LARAVEL_START : $ this ->request ->server ('REQUEST_TIME_FLOAT ' );
36
+ $ startTime = defined ('LARAVEL_START ' ) ? LARAVEL_START : $ this ->request ->server ('REQUEST_TIME_FLOAT ' , $ _SERVER [ ' REQUEST_TIME_FLOAT ' ] );
37
37
38
38
return floor ((microtime (true ) - $ startTime ) * 1000 ).'ms ' ;
39
39
}),
You can’t perform that action at this time.
0 commit comments