From bd9d8eaf71a1d7343057bb8be5701e09fc726fcb Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Thu, 8 Apr 2021 14:29:15 -0400 Subject: [PATCH] docs: add replace log format directive, global log option (#147) * caddyfile/directives/log: add docs for new replace directive This commit corresponds with the functionality added in this PR: https://github.com/caddyserver/caddy/pull/4029 * caddyfile: add documentation for new global log option This corresponds with the changes in this PR: https://github.com/caddyserver/caddy/pull/4028 --- src/docs/markdown/caddyfile/directives/log.md | 8 ++++++++ src/docs/markdown/caddyfile/options.md | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/docs/markdown/caddyfile/directives/log.md b/src/docs/markdown/caddyfile/directives/log.md index 44b4b10..05f5dab 100644 --- a/src/docs/markdown/caddyfile/directives/log.md +++ b/src/docs/markdown/caddyfile/directives/log.md @@ -165,6 +165,14 @@ Marks a field to be skipped from being encoded. delete ``` +##### replace + +Marks a field to be replaced with the provided string at encoding time. + +```caddy-d + replace +``` + ##### ip_mask Masks IP addresses in the field using a CIDR mask, i.e. the number of bytes from the IP to retain, starting from the left side. There is separate configuration for IPv4 and IPv6 addresses. diff --git a/src/docs/markdown/caddyfile/options.md b/src/docs/markdown/caddyfile/options.md index ba3bd99..f5f74e9 100644 --- a/src/docs/markdown/caddyfile/options.md +++ b/src/docs/markdown/caddyfile/options.md @@ -32,6 +32,13 @@ Possible options are: origins enforce_origin } + log [name] { + output ... + format ... + level + include + exclude + } # TLS Options auto_https off|disable_redirects @@ -96,6 +103,14 @@ Customizes the [admin API endpoint](/docs/api). If `off`, then the admin endpoin - **enforce_origin** enables enforcement of the Origin header. (This is different from enforcing origins generally, which is always done.) +##### `log` +Customizes the named logger. The name can be passed to indicate a specific logger to customize the behavior for. If no name is specified, the behavior of the default logger is modified. This option can be specified multiple times to configure different loggers. You can read more about the default logger and other logging behaviors in the [logging documentation](/docs/logging/). + +- **output** configures where to write the logs. See the [log directive](/docs/caddyfile/directives/log#output-modules) documentation for more information, which has the same structure. +- **format** describes how to encode, or format, the logs. See the [log directive](/docs/caddyfile/directives/log#format-modules) documentation for more information, which has the same structure. +- **level** is the minimum entry level to log. Default: `INFO` +- **include** identifies the loggers that are included in this log configuration. See the [JSON documentation](/docs/json/logging/logs/include/) for more information. +- **exclude** identifies the loggers that are excluded from this log configuration. See the [JSON documentation](/docs/json/logging/logs/exclude/) for more information. ## TLS Options