Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/niftynei/cln-logmaid
Logrotate config file + a parser
https://github.com/niftynei/cln-logmaid
Last synced: 3 months ago
JSON representation
Logrotate config file + a parser
- Host: GitHub
- URL: https://github.com/niftynei/cln-logmaid
- Owner: niftynei
- Created: 2022-07-23T19:25:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-23T19:40:16.000Z (over 2 years ago)
- Last Synced: 2023-03-24T08:46:12.311Z (almost 2 years ago)
- Language: Python
- Size: 1.95 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Core-Lightning Log Monitor + Rotator
Core-Lightning allows for automatic log rotation use `logrotate`.
This repo contains a barebones `lightningd` entry for logrotate. It
rotates log daily. It also calls a prerotation handler which looks for
"BROKEN" in the logs, and emails you that day's breaks.### Usage
1. Copy `lightningd` into `/etc/logrotate.d`
2. Update the `lightningd` to point to the correct logfile, where `parselogs.py` is and the PID file location for your lightningd daemon
3. Update `parselogs.py` with your email information (password and email to send/receive from)
4. Make sure parselogs.py can run `chmod +x parselogs.py`
4. ???
5. Have your logs rotate automatically and get emailed notifications when things break.```
/PATH/TO/.lightning/logs/log {
...
prerotate
/PATH/TO/parselogs.py
endscript
postrotate
kill -HUP $(cat /PATH/TO/.lightning/lightning.pid)
endscript
``````parselogs.py
mailpwd = ''
send_email = ''
recv_email = ''
default_log_path = '/home/niftynei/.lightning/logs/log'
```To test w/o executing, call `logrotate -vdf /etc/logrotate.d/lightningd`
To execute, call `logrotate -vf /etc/logrotate.d/lightningd`