This commit is contained in:
Ririsoft 2025-01-01 23:19:35 +01:00 committed by GitHub
commit 386f1a00e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -134,8 +134,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
@ -147,6 +155,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`.