File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
website/content/middleware Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,13 @@ and handles the control to the centralized
21
21
``` go
22
22
e := echo.New ()
23
23
e.Use (middleware.RecoverWithConfig (middleware.RecoverConfig {
24
- StackSize : 1 << 10 , // 1 KB
24
+ StackSize : 1 << 10 , // 1 KB
25
+ LogLevel : log.ERROR ,
25
26
}))
26
27
```
27
28
28
- Example above uses a ` StackSize ` of 1 KB and default values for ` DisableStackAll `
29
- and ` DisablePrintStack ` .
29
+ Example above uses a ` StackSize ` of 1 KB, ` LogLevel ` of error and
30
+ default values for ` DisableStackAll ` and ` DisablePrintStack ` .
30
31
31
32
## Configuration
32
33
@@ -47,6 +48,10 @@ RecoverConfig struct {
47
48
// DisablePrintStack disables printing stack trace.
48
49
// Optional. Default value as false.
49
50
DisablePrintStack bool ` json:"disable_print_stack"`
51
+
52
+ // LogLevel is log level to printing stack trace.
53
+ // Optional. Default value 0 (Print).
54
+ LogLevel log.Lvl
50
55
}
51
56
```
52
57
@@ -58,5 +63,6 @@ DefaultRecoverConfig = RecoverConfig{
58
63
StackSize : 4 << 10 , // 4 KB
59
64
DisableStackAll : false ,
60
65
DisablePrintStack : false ,
66
+ LogLevel : 0 ,
61
67
}
62
68
```
You can’t perform that action at this time.
0 commit comments