We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f5ff994 + a56a79e commit 1659288Copy full SHA for 1659288
backend/pkg/accesslog/middleware_gin.go
@@ -117,9 +117,14 @@ func (a AccessLogger) LogFunc(
117
Log(logLevel)
118
}
119
120
+// Middleware implementsa gin compatible MiddlewareFunc
121
+//
122
+// NOTE: This accesslog middleware also implements the legacy requestlog
123
+// middleware.
124
func (a AccessLogger) Middleware(c *gin.Context) {
125
ctx := c.Request.Context()
126
startTime := time.Now()
127
+ ctx = log.WithContext(ctx, log.New(log.Ctx{}))
128
ctx = withContext(ctx, &logContext{maxErrors: DefaultMaxErrors})
129
c.Request = c.Request.WithContext(ctx)
130
defer a.LogFunc(ctx, c, startTime)
0 commit comments