(e *logrus.Entry)
| 93 | } |
| 94 | |
| 95 | func (f *accessLogFormatter) Format(e *logrus.Entry) ([]byte, error) { |
| 96 | keys := []string{ |
| 97 | "host", "auth-user", "timestamp", "method", "uri", "proto", |
| 98 | "status", "response-size", "referer", "user-agent", |
| 99 | "duration", "requested-host", "flow-id", "audit"} |
| 100 | |
| 101 | values := make([]any, len(keys)) |
| 102 | for i, key := range keys { |
| 103 | if s, ok := e.Data[key].(string); ok { |
| 104 | values[i] = omitWhitespace(s) |
| 105 | } else { |
| 106 | values[i] = e.Data[key] |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | return fmt.Appendf(nil, f.format, values...), nil |
| 111 | } |
| 112 | |
| 113 | func stripQueryString(u string) string { |
| 114 | if i := strings.IndexRune(u, '?'); i < 0 { |
no test coverage detected