|
@@ -21,7 +21,7 @@ func GinLoggerWithStringLogger(config GinLoggerConfig) gin.HandlerFunc {
|
|
|
raw := c.Request.URL.RawQuery
|
|
|
c.Next()
|
|
|
end := time.Now()
|
|
|
- latency := end.Sub(start)
|
|
|
+ latency := end.Sub(start).String()
|
|
|
clientIP := c.ClientIP()
|
|
|
method := c.Request.Method
|
|
|
statusCode := c.Writer.Status()
|
|
@@ -52,7 +52,7 @@ func GinLoggerWithComplexLogger(config GinLoggerConfig) gin.HandlerFunc {
|
|
|
raw := c.Request.URL.RawQuery
|
|
|
c.Next()
|
|
|
end := time.Now()
|
|
|
- latency := end.Sub(start)
|
|
|
+ latency := end.Sub(start).String()
|
|
|
clientIP := c.ClientIP()
|
|
|
method := c.Request.Method
|
|
|
statusCode := c.Writer.Status()
|
|
@@ -66,7 +66,7 @@ func GinLoggerWithComplexLogger(config GinLoggerConfig) gin.HandlerFunc {
|
|
|
mv := map[string]string{
|
|
|
"time": end.Format("2006/01/02 - 15:04:05"),
|
|
|
"status": strconv.Itoa(statusCode),
|
|
|
- "latency": fmt.Sprintf("%13v", latency),
|
|
|
+ "latency": latency,
|
|
|
"clientIP": clientIP,
|
|
|
"method": method,
|
|
|
"path": path,
|