Implement gin request logger with param filtering
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jessevdk/go-flags"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/sosedoff/pgweb/pkg/api"
|
||||
"github.com/sosedoff/pgweb/pkg/bookmarks"
|
||||
@@ -183,7 +184,10 @@ func printVersion() {
|
||||
}
|
||||
|
||||
func startServer() {
|
||||
router := gin.Default()
|
||||
router := gin.New()
|
||||
|
||||
router.Use(api.RequestLogger(logrus.New()))
|
||||
router.Use(gin.Recovery())
|
||||
|
||||
// Enable HTTP basic authentication only if both user and password are set
|
||||
if options.AuthUser != "" && options.AuthPass != "" {
|
||||
|
||||
Reference in New Issue
Block a user