Merge pull request #3 from twofas/fix/do-not-log-client-ip

Disable client-ip logging
This commit is contained in:
Tobiasz Heller 2023-05-22 20:07:14 +02:00 committed by GitHub
commit ba6c0abfeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,9 +2,10 @@ package http
import (
"bytes"
"io"
"github.com/gin-gonic/gin"
"github.com/twofas/2fas-server/internal/common/logging"
"io"
)
func RequestJsonLogger() gin.HandlerFunc {
@ -17,7 +18,6 @@ func RequestJsonLogger() gin.HandlerFunc {
c.Request.Body = io.NopCloser(&buf)
logging.WithFields(logging.Fields{
"client_ip": c.ClientIP(),
"method": c.Request.Method,
"path": c.Request.URL.Path,
"headers": c.Request.Header,
@ -29,7 +29,6 @@ func RequestJsonLogger() gin.HandlerFunc {
c.Next()
logging.WithFields(logging.Fields{
"client_ip": c.ClientIP(),
"method": c.Request.Method,
"path": c.Request.URL.Path,
"request_id": c.GetString(RequestIdKey),