Skip to content

Commit 07c4ed4

Browse files
bagasmejolheisertechknowlogickzeripath
authored
[Docs] Logging Configuration - Use logrotate Instead (#9930)
* Logging Configuration - Add logrotate * Delete instead duplicate * Apply suggestions from @jolheiser Co-Authored-By: John Olheiser <[email protected]> * Quote false * Replace program with utility * Whoops, use --debug switch instead * Optional immediate reload by --force switch * Update docs/content/doc/advanced/logging-documentation.en-us.md Co-authored-by: John Olheiser <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent 0122cf9 commit 07c4ed4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,14 @@ func newNewoneLogService() {
421421

422422
You should then add `newOneLogService` to `NewServices()` in
423423
`modules/setting/setting.go`
424+
425+
## Using `logrotate` instead of built-in log rotation
426+
427+
Gitea includes built-in log rotation, which should be enough for most deployments. However, if you instead want to use the `logrotate` utility:
428+
429+
- Disable built-in log rotation by setting `LOG_ROTATE` to `false` in your `app.ini`.
430+
- Install `logrotate`.
431+
- Configure `logrotate` to match your deployment requirements, see `man 8 logrotate` for configuration syntax details. In the `postrotate/endscript` block send Gitea a `USR1` signal via `kill -USR1` or `kill -10`, or run `gitea manager logging release-and-reopen` (with the appropriate environment). Ensure that your configurations apply to all files emitted by Gitea loggers as described in the above sections.
432+
- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations.
433+
434+
The next `logrotate` jobs will include your configurations, so no restart is needed. You can also immediately reload `logrotate` with `logrotate /etc/logrotate.conf --force`.

0 commit comments

Comments
 (0)