diff options
author | Bagas Sanjaya <bagasdotme@gmail.com> | 2020-07-16 23:02:29 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 12:02:29 -0400 |
commit | 07c4ed4cda04e06bcf64d2ce1251bad25febff7a (patch) | |
tree | 17ab271bbac09873518948a9f3d3d36e3747a90c | |
parent | 0122cf9cdc4fc029aaafbfb777083891f4af6a6a (diff) | |
download | gitea-07c4ed4cda04e06bcf64d2ce1251bad25febff7a.tar.gz gitea-07c4ed4cda04e06bcf64d2ce1251bad25febff7a.zip |
[Docs] Logging Configuration - Use `logrotate` Instead (#9930)
* Logging Configuration - Add logrotate
* Delete instead duplicate
* Apply suggestions from @jolheiser
Co-Authored-By: John Olheiser <42128690+jolheiser@users.noreply.github.com>
* 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 <42128690+jolheiser@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r-- | docs/content/doc/advanced/logging-documentation.en-us.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/content/doc/advanced/logging-documentation.en-us.md b/docs/content/doc/advanced/logging-documentation.en-us.md index f3880be7c4..0b3b018fab 100644 --- a/docs/content/doc/advanced/logging-documentation.en-us.md +++ b/docs/content/doc/advanced/logging-documentation.en-us.md @@ -421,3 +421,14 @@ func newNewoneLogService() { You should then add `newOneLogService` to `NewServices()` in `modules/setting/setting.go` + +## Using `logrotate` instead of built-in log rotation + +Gitea includes built-in log rotation, which should be enough for most deployments. However, if you instead want to use the `logrotate` utility: + +- Disable built-in log rotation by setting `LOG_ROTATE` to `false` in your `app.ini`. +- Install `logrotate`. +- 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. +- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations. + +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`. |