mirror of
https://github.com/caddyserver/caddy.git
synced 2025-08-07 09:04:04 -04:00
Updated v2: Documentation (markdown)
parent
408b9411f4
commit
1975625232
@ -919,6 +919,16 @@ Emits logs to standard error. This is the default writer.
|
||||
}
|
||||
```
|
||||
|
||||
#### caddy.logging.writers.discard
|
||||
|
||||
Discards all writes. This effectively disables the log, and is only useful if you want to turn off the default log.
|
||||
|
||||
```json
|
||||
{
|
||||
"output": "discard"
|
||||
}
|
||||
```
|
||||
|
||||
#### caddy.logging.writers.file
|
||||
|
||||
Writes logs to a local file, optionally with automatic log rolling. Log rolling is enabled by default just in case, but can be disabled if you have an external service rotating logs. Most use cases will only need to specify a filename, since other defaults are reasonable.
|
||||
@ -961,7 +971,8 @@ In addition to the properties specific to each encoder, these properties are ava
|
||||
"stacktrace_key": "stacktrace",
|
||||
"line_ending": "\n",
|
||||
"time_format": "unix_seconds_float",
|
||||
"duration_format": "seconds"
|
||||
"duration_format": "seconds",
|
||||
"level_format": "lower"
|
||||
}
|
||||
```
|
||||
|
||||
@ -974,12 +985,17 @@ In addition to the properties specific to each encoder, these properties are ava
|
||||
- `line_ending`: The line ending to use.
|
||||
- `time_format`: The format to use for timestamps. Can be: "unix_seconds_float", "unix_milli_float", "unix_nano", "iso8601", "rfc3339", "rfc3339_nano", "wall", "wall_milli", "wall_nano", or [any time format value accepted by Go's time package](https://golang.org/pkg/time/#pkg-constants).
|
||||
- `duration_format`: The format to use for duration values. Can be "seconds", "nano", or "string".
|
||||
- `level_format`: The format to use for the log level. Can be "lower", "upper", or "color" (only recommended for the console encoder).
|
||||
|
||||
#### caddy.logging.encoders.console
|
||||
|
||||
Formats log enties for human readability on the console.
|
||||
|
||||
(TODO)
|
||||
```json
|
||||
{
|
||||
"format": "console"
|
||||
}
|
||||
```
|
||||
|
||||
#### caddy.logging.encoders.filter
|
||||
|
||||
@ -1025,7 +1041,7 @@ This filter masks IP addresses.
|
||||
|
||||
#### caddy.logging.encoders.json
|
||||
|
||||
JSON formatted logs. There is one JSON document per line/entry.
|
||||
JSON formatted logs. There is one JSON document per line/entry. This is the default encoder.
|
||||
|
||||
```json
|
||||
{
|
||||
@ -1033,8 +1049,6 @@ JSON formatted logs. There is one JSON document per line/entry.
|
||||
}
|
||||
```
|
||||
|
||||
(TODO)
|
||||
|
||||
#### caddy.logging.encoders.logfmt
|
||||
|
||||
Formats each structured log entry as [logfmt](https://www.brandur.org/logfmt). Note that this format does not support complex types, so objects and maps cannot be encoded.
|
||||
|
Loading…
x
Reference in New Issue
Block a user