log: Add docs for mode (#436)

Ref: caddyserver/caddy#6314
This commit is contained in:
Jeremy Lin 2025-01-02 12:01:06 -08:00 committed by GitHub
parent e4fcafc0b6
commit f378fbf2fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -136,6 +136,7 @@ Log rolling is provided by [lumberjack <img src="/old/resources/images/external-
```caddy-d
output file <filename> {
mode <mode>
roll_disabled
roll_size <size>
roll_uncompressed
@ -147,6 +148,10 @@ output file <filename> {
- **&lt;filename&gt;** is the path to the log file.
- **mode** is the Unix file mode/permissions to use for the log file. The mode consists of between 1 and 4 octal digits (same as the numeric format accepted by the Unix [chmod <img src="/old/resources/images/external-link.svg" class="external-link">](https://en.wikipedia.org/wiki/Chmod) command, except that an all-zero mode is interpreted as the default mode `600`). For example, `644` provides read/write access to the log file's owner, but only read access to the group owner and other users; `600` provides read/write access to the log file's owner, and no access to anyone else.
Default: `600`
- **roll_disabled** disables log rolling. This can lead to disk space depletion, so only use this if your log files are maintained some other way.
- **roll_size** is the size at which to roll the log file. The current implementation supports megabyte resolution; fractional values are rounded up to the next whole megabyte. For example, `1.1MiB` is rounded up to `2MiB`.
@ -167,7 +172,6 @@ output file <filename> {
- **roll_keep_for** is how long to keep rolled files as a [duration string](/docs/conventions#durations). The current implementation supports day resolution; fractional values are rounded up to the next whole day. For example, `36h` (1.5 days) is rounded up to `48h` (2 days). Default: `2160h` (90 days)
#### net
A network socket. If the socket goes down, it will dump logs to stderr while it attempts to reconnect.