Skip to content

Commit 300d3ce

Browse files
authored
Merge pull request #203 from kaleido-io/fix-default-api-loglevel
[ffapi] Ensure Default Log Level is Set in Handler
2 parents 9fae2a7 + b252e20 commit 300d3ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/ffapi/handler.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,10 @@ func (hs *HandlerFactory) getTimeout(req *http.Request) time.Duration {
365365
}
366366

367367
func (hs *HandlerFactory) APIWrapper(handler HandlerFunction) http.HandlerFunc {
368+
if hs.apiEntryLoggingLevel == 0 {
369+
hs.SetAPIEntryLoggingLevel(logrus.InfoLevel)
370+
}
368371
return func(res http.ResponseWriter, req *http.Request) {
369-
370372
reqTimeout := hs.getTimeout(req)
371373
ctx, cancel := context.WithTimeout(req.Context(), reqTimeout)
372374
httpReqID := req.Header.Get(RequestIDHeader())

pkg/ffapi/handler_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ func newTestHandlerFactory(basePath string, basePathParams []*PathParam) *Handle
6060
BasePath: basePath,
6161
BasePathParams: basePathParams,
6262
}
63-
hr.SetAPIEntryLoggingLevel(logrus.DebugLevel)
6463
return hr
6564
}
6665

0 commit comments

Comments
 (0)