1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

refactor: logging (resolve #169)

This commit is contained in:
Ferdinand Mütsch
2021-04-16 15:59:39 +02:00
parent 337b39481b
commit dca736752e
11 changed files with 122 additions and 65 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"embed"
sentryhttp "github.com/getsentry/sentry-go/http"
"io/fs"
"log"
"net/http"
@@ -183,7 +184,7 @@ func main() {
router.Use(middlewares.NewLoggingMiddleware(logbuch.Info, []string{"/assets"}))
router.Use(handlers.RecoveryHandler())
if config.Sentry.Dsn != "" {
router.Use(middlewares.NewSentryMiddleware())
router.Use(sentryhttp.New(sentryhttp.Options{Repanic: true}).Handle)
}
rootRouter.Use(middlewares.NewSecurityMiddleware())