fix: adjust log middleware
This commit is contained in:
+1
-3
@@ -12,8 +12,6 @@ import (
|
|||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
//var timeFormat = "02/Jan/2006:15:04:05 -0700"
|
|
||||||
|
|
||||||
// LogMiddleware Logger is the logrus logger handler
|
// LogMiddleware Logger is the logrus logger handler
|
||||||
func LogMiddleware(notLogged ...string) gin.HandlerFunc {
|
func LogMiddleware(notLogged ...string) gin.HandlerFunc {
|
||||||
//hostname, err := os.Hostname()
|
//hostname, err := os.Hostname()
|
||||||
@@ -58,7 +56,7 @@ func LogMiddleware(notLogged ...string) gin.HandlerFunc {
|
|||||||
entry := logging.Logger.WithFields(logrus.Fields{
|
entry := logging.Logger.WithFields(logrus.Fields{
|
||||||
//"hostname": hostname,
|
//"hostname": hostname,
|
||||||
"statusCode": statusCode,
|
"statusCode": statusCode,
|
||||||
"latency": latency, // time to process
|
"latency": latency,
|
||||||
"clientIP": clientIP,
|
"clientIP": clientIP,
|
||||||
"method": c.Request.Method,
|
"method": c.Request.Method,
|
||||||
"path": path,
|
"path": path,
|
||||||
|
|||||||
Reference in New Issue
Block a user