add documentation for output file log mode option

This commit is contained in:
Ririsoft 2024-06-12 18:36:45 +02:00
parent 50fb6784f2
commit 8358ca9e05

View file

@ -129,8 +129,16 @@ A file. By default, log files are rotated ("rolled") to prevent disk space exhau
Log rolling is provided by [lumberjack <img src="/old/resources/images/external-link.svg" class="external-link">](https://github.com/natefinch/lumberjack) Log rolling is provided by [lumberjack <img src="/old/resources/images/external-link.svg" class="external-link">](https://github.com/natefinch/lumberjack)
<aside class="tip">
**A note about reloading log file options:** A server restart is required to apply configuration changes to a given output file.
The changes will not be applied at server reload time, unless you add a new log filename.
</aside>
```caddy-d ```caddy-d
output file <filename> { output file <filename> {
mode <mode>
roll_disabled roll_disabled
roll_size <size> roll_size <size>
roll_uncompressed roll_uncompressed
@ -142,6 +150,10 @@ output file <filename> {
- **&lt;filename&gt;** is the path to the log file. - **&lt;filename&gt;** is the path to the log file.
- **mode** is the file mode octal value as specified with the unix `chmod` command. For example `0600` would set the mode to `rw-,---,---`, while `0640` would set the mode to `rw-,r--,---`.
Default: `0600`
- **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_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`. - **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`.