summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/marshalers.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-07-07 08:11:35 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-07-07 08:11:35 -0600
commit0bf2565c37c0b2e4857be70c5302d6ad5c34b80d (patch)
tree567a1febc7f1a9ac56c386e0ebe9d5f4e449a317 /modules/caddyhttp/marshalers.go
parent7bfe5b6c9520daabb71d22f24470bc91eca931d9 (diff)
caddyhttp: Reorder some access log fields; add host matcher test case
This field order reads a little more naturally.
Diffstat (limited to 'modules/caddyhttp/marshalers.go')
-rw-r--r--modules/caddyhttp/marshalers.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/caddyhttp/marshalers.go b/modules/caddyhttp/marshalers.go
index e35a73e..7f95923 100644
--- a/modules/caddyhttp/marshalers.go
+++ b/modules/caddyhttp/marshalers.go
@@ -26,11 +26,11 @@ type LoggableHTTPRequest struct{ *http.Request }
// MarshalLogObject satisfies the zapcore.ObjectMarshaler interface.
func (r LoggableHTTPRequest) MarshalLogObject(enc zapcore.ObjectEncoder) error {
- enc.AddString("method", r.Method)
- enc.AddString("uri", r.RequestURI)
- enc.AddString("proto", r.Proto)
enc.AddString("remote_addr", r.RemoteAddr)
+ enc.AddString("proto", r.Proto)
+ enc.AddString("method", r.Method)
enc.AddString("host", r.Host)
+ enc.AddString("uri", r.RequestURI)
enc.AddObject("headers", LoggableHTTPHeader(r.Header))
if r.TLS != nil {
enc.AddObject("tls", LoggableTLSConnState(*r.TLS))