Skip to content
New issue

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

Add documentation for replace log format directive, global log option #147

Merged
merged 2 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/docs/markdown/caddyfile/directives/log.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@ Marks a field to be skipped from being encoded.
<field> delete
```

##### replace

Marks a field to be replaced with the provided string at encoding time.

```caddy-d
<field> replace <replacement>
```

##### 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.
Expand Down
15 changes: 15 additions & 0 deletions src/docs/markdown/caddyfile/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ Possible options are:
origins <origins...>
enforce_origin
}
log [name] {
output <writer_module> ...
format <encoder_module> ...
level <level>
include <namespaces...>
exclude <namespaces...>
}

# TLS Options
auto_https off|disable_redirects
Expand Down Expand Up @@ -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
Expand Down