mirror of
https://github.com/caddyserver/caddy.git
synced 2025-08-07 09:04:04 -04:00
Fill out more log docs
parent
785b1d1450
commit
408b9411f4
@ -872,8 +872,8 @@ Configures Caddy logs.
|
|||||||
"first": 100,
|
"first": 100,
|
||||||
"thereafter": 100
|
"thereafter": 100
|
||||||
},
|
},
|
||||||
"allow_modules": [],
|
"include": [],
|
||||||
"deny_modules": []
|
"exclude": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -890,10 +890,10 @@ Configures Caddy logs.
|
|||||||
- `logs.default.sampling.interval`: The window over which to conduct sampling.
|
- `logs.default.sampling.interval`: The window over which to conduct sampling.
|
||||||
- `logs.default.sampling.first`: Log this many entries within a given level and message for each interval.
|
- `logs.default.sampling.first`: Log this many entries within a given level and message for each interval.
|
||||||
- `logs.default.sampling.thereafter`: If more entries with the same level and message are seen during the same interval, keep one in this many entries until the end of the interval.
|
- `logs.default.sampling.thereafter`: If more entries with the same level and message are seen during the same interval, keep one in this many entries until the end of the interval.
|
||||||
- `logs.default.allow_modules`: Allow modules within this namespace to emit logs here. Mutually exclusive with `deny_modules`.
|
- `logs.default.include`: Allow modules within this namespace to emit logs here. Mutually exclusive with `exclude`.
|
||||||
- `logs.default.deny_modules`: Deny modules within this namespace from emitting logs here. Mutually exclusive with `allow_modules`.
|
- `logs.default.exlucde`: Deny modules within this namespace from emitting logs here. Mutually exclusive with `include`.
|
||||||
|
|
||||||
If both `allow_modules` and `deny_modules` are populated, longer namespaces have priority. If neither are populated, all logs are emitted.
|
If both `include` and `exclude` are populated, longer namespaces have priority. If neither are populated, all logs are emitted.
|
||||||
|
|
||||||
### caddy.logging.writers
|
### caddy.logging.writers
|
||||||
|
|
||||||
@ -949,6 +949,32 @@ Writes logs to a local file, optionally with automatic log rolling. Log rolling
|
|||||||
|
|
||||||
Encoders determine how log entries are encoded (formatted).
|
Encoders determine how log entries are encoded (formatted).
|
||||||
|
|
||||||
|
In addition to the properties specific to each encoder, these properties are available for all encoders (and have the following defaults):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"message_key": "msg",
|
||||||
|
"level_key": "level",
|
||||||
|
"time_key": "ts",
|
||||||
|
"name_key": "logger",
|
||||||
|
"caller_key": "caller",
|
||||||
|
"stacktrace_key": "stacktrace",
|
||||||
|
"line_ending": "\n",
|
||||||
|
"time_format": "unix_seconds_float",
|
||||||
|
"duration_format": "seconds"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- `message_key`: The key for the message field.
|
||||||
|
- `level_key`: The key for the level field.
|
||||||
|
- `time_key`: The key for the timestamp field.
|
||||||
|
- `name_key`: The key for the name of the logger field.
|
||||||
|
- `caller_key`: The key for the caller field.
|
||||||
|
- `stacktrace_key`: The key for the stacktrace field.
|
||||||
|
- `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".
|
||||||
|
|
||||||
#### caddy.logging.encoders.console
|
#### caddy.logging.encoders.console
|
||||||
|
|
||||||
Formats log enties for human readability on the console.
|
Formats log enties for human readability on the console.
|
||||||
@ -1022,7 +1048,7 @@ Formats each structured log entry as [logfmt](https://www.brandur.org/logfmt). N
|
|||||||
|
|
||||||
#### caddy.logging.encoders.string
|
#### caddy.logging.encoders.string
|
||||||
|
|
||||||
An encoder that will write an entry that consists exclusively of a single field in the log. This is useful if a particular field in the log entry is already formatted the way you want.
|
An encoder that will write an entry that consists exclusively of a single field in the log. This is useful if that particular field is already formatted the way you want your logs formatted.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user