Skip to content

Commit 7ef11c5

Browse files
authored
Add LogLevel to recover middleware docs (#151)
1 parent 765cf0d commit 7ef11c5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

website/content/middleware/recover.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ and handles the control to the centralized
2121
```go
2222
e := echo.New()
2323
e.Use(middleware.RecoverWithConfig(middleware.RecoverConfig{
24-
StackSize: 1 << 10, // 1 KB
24+
StackSize: 1 << 10, // 1 KB
25+
LogLevel: log.ERROR,
2526
}))
2627
```
2728

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`.
3031

3132
## Configuration
3233

@@ -47,6 +48,10 @@ RecoverConfig struct {
4748
// DisablePrintStack disables printing stack trace.
4849
// Optional. Default value as false.
4950
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
5055
}
5156
```
5257

@@ -58,5 +63,6 @@ DefaultRecoverConfig = RecoverConfig{
5863
StackSize: 4 << 10, // 4 KB
5964
DisableStackAll: false,
6065
DisablePrintStack: false,
66+
LogLevel: 0,
6167
}
6268
```

0 commit comments

Comments
 (0)