✨ Can disable request logging
This commit is contained in:
parent
a64e7499bc
commit
9f9ccedbc7
@ -21,10 +21,12 @@ func InitAdministration() *fiber.App {
|
|||||||
TrustedProxies: viper.GetStringSlice("security.administration_trusted_proxies"),
|
TrustedProxies: viper.GetStringSlice("security.administration_trusted_proxies"),
|
||||||
})
|
})
|
||||||
|
|
||||||
app.Use(logger.New(logger.Config{
|
if viper.GetBool("performance.request_logging") {
|
||||||
Output: log.Logger,
|
app.Use(logger.New(logger.Config{
|
||||||
Format: "[Administration] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
Output: log.Logger,
|
||||||
}))
|
Format: "[Administration] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
app.Use(basicauth.New(basicauth.Config{
|
app.Use(basicauth.New(basicauth.Config{
|
||||||
Realm: fmt.Sprintf("RoadSign v%s", roadsign.AppVersion),
|
Realm: fmt.Sprintf("RoadSign v%s", roadsign.AppVersion),
|
||||||
|
@ -22,10 +22,12 @@ func InitServer() *fiber.App {
|
|||||||
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
BodyLimit: viper.GetInt("hypertext.limitation.max_body_size"),
|
||||||
})
|
})
|
||||||
|
|
||||||
app.Use(logger.New(logger.Config{
|
if viper.GetBool("performance.request_logging") {
|
||||||
Output: log.Logger,
|
app.Use(logger.New(logger.Config{
|
||||||
Format: "[Proxies] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
Output: log.Logger,
|
||||||
}))
|
Format: "[Proxies] [${time}] ${status} - ${latency} ${method} ${path}\n",
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
if viper.GetInt("hypertext.limitation.max_qps") > 0 {
|
if viper.GetInt("hypertext.limitation.max_qps") > 0 {
|
||||||
app.Use(limiter.New(limiter.Config{
|
app.Use(limiter.New(limiter.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user