https://github.com/namachan10777/nginx-log-rotator
https://github.com/namachan10777/nginx-log-rotator
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/namachan10777/nginx-log-rotator
- Owner: namachan10777
- License: mit
- Created: 2021-09-22T04:45:08.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-22T12:41:25.000Z (over 3 years ago)
- Last Synced: 2025-03-15T07:35:18.120Z (3 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nginx-log-rotator
Nginx用のログ切り捨てツール.
Dockerで動くNginxプロセスがmtail用に吐くログを短縮するのが目的
シグナルは全てNginxへ送られる。exit_statusはnginxの終了コードと同じになる。```sh
nginx_log_rotator --config /etc/log_rotate_config.yaml
```## 設定例
`rotate_span`の単位は秒、`log_inherit_kilobytes`で
何kilobyte作り直したログファイルに受け継ぐか決められる。
最初の不完全な一行は切り捨てる。```yaml
---
cmd:
- nginx
- "-g"
- "daemon off;"
rotate_span: 1800
rotate_targets:
- /var/log/mtail/access.log
log_inherit_kilobytes: 256
```