diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-12 14:31:20 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-12 14:31:20 -0700 |
commit | 87b6cf470baacd659cd20815de2804ae4a31df7f (patch) | |
tree | 2faea4d119909790d0b1a489c0ea46b34f44dd52 /modules/caddyhttp/server.go | |
parent | f935458e3e30a8d9f47f37ad35fe9c546b841fa3 (diff) |
Minor improvements; comments and shorter placeholders & module IDs
Diffstat (limited to 'modules/caddyhttp/server.go')
-rw-r--r-- | modules/caddyhttp/server.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index c34444e..83b90e6 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -447,6 +447,10 @@ func (*HTTPErrorConfig) WithError(r *http.Request, err error) *http.Request { // ServerLogConfig describes a server's logging configuration. type ServerLogConfig struct { + // LoggerNames maps request hostnames to a custom logger name. + // For example, a mapping of "example.com" to "example" would + // cause access logs from requests with a Host of example.com + // to be emitted by a logger named "http.log.access.example". LoggerNames map[string]string `json:"logger_names,omitempty"` } @@ -504,7 +508,7 @@ func cloneURL(from, to *url.URL) { const ( // CommonLogFormat is the common log format. https://en.wikipedia.org/wiki/Common_Log_Format - CommonLogFormat = `{http.request.remote.host} ` + CommonLogEmptyValue + ` {http.handlers.authentication.user.id} [{time.now.common_log}] "{http.request.orig_method} {http.request.orig_uri} {http.request.proto}" {http.response.status} {http.response.size}` + CommonLogFormat = `{http.request.remote.host} ` + CommonLogEmptyValue + ` {http.authentication.user.id} [{time.now.common_log}] "{http.request.orig_method} {http.request.orig_uri} {http.request.proto}" {http.response.status} {http.response.size}` // CommonLogEmptyValue is the common empty log value. CommonLogEmptyValue = "-" |