File tree 2 files changed +1
-18
lines changed
2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ func (auditor *AzureAuditor) Init() {
83
83
auditor .initPrometheus ()
84
84
auditor .initCache ()
85
85
auditor .initCron ()
86
-
86
+
87
87
validator .Logger = auditor .Logger
88
88
}
89
89
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "fmt"
5
- "net/http"
6
-
7
- stringsCommon "github.com/webdevops/go-common/strings"
8
4
"go.uber.org/zap"
9
5
"go.uber.org/zap/zapcore"
10
6
)
13
9
logger * zap.SugaredLogger
14
10
)
15
11
16
- func buildContextLoggerFromRequest (r * http.Request ) * zap.SugaredLogger {
17
- contextLogger := logger .With (zap .String ("requestPath" , r .URL .Path ))
18
-
19
- for name , value := range r .URL .Query () {
20
- fieldName := fmt .Sprintf ("param%s" , stringsCommon .UppercaseFirst (name ))
21
- fieldValue := value
22
-
23
- contextLogger = contextLogger .With (zap .Any (fieldName , fieldValue ))
24
- }
25
-
26
- return contextLogger
27
- }
28
-
29
12
func initLogger () * zap.SugaredLogger {
30
13
var config zap.Config
31
14
if opts .Logger .Development {
You can’t perform that action at this time.
0 commit comments