We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogFieldName
// http_option.go var DefaultHttpLogFieldName = &HttpLogFieldName{ Protocol: "protocol", Path: "path", Status: "status", UserAgent: "ua", RequestedTime: "time", ElapsedTime: "elapsed(ms)", QueryString: "qs", ClientIp: "client-ip", } type HttpLogFieldName struct { Protocol string Path string Status string UserAgent string RequestedTime string ElapsedTime string QueryString string ClientIp string } func WithLogFieldName(logFieldName HttpLogFieldName) httpOption { return func(cfg *httpConfig) { cfg.logFieldName = logFieldName } } // http.go e := le.l.Log(). Str(le.cfg.logFieldName.Protocol, "http"). Str(le.cfg.logFieldName.Path, le.r.URL.Path). Str(le.cfg.logFieldName.Status, strconv.Itoa(le.ww.Status())). Str(le.cfg.logFieldName.UserAgent, le.r.UserAgent()). Str(le.cfg.logFieldName.RequestedTime, t.UTC().Format(time.RFC3339Nano)). Dur(le.cfg.logFieldName.ElapsedTime, time.Since(t))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
LogFieldName
for customizing log field name?The text was updated successfully, but these errors were encountered: