Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if $programname == 'myapp' then {
- /var/log/myapp/myapp.log
- stop
- }
- [Unit]
- Description=myapp
- [Service]
- User=myapp
- ExecStart=/usr/bin/myapp
- StandardOutput=syslog
- StandardError=syslog
- SyslogIdentifier=myapp
- [Install]
- WantedBy=multi-user.target
- /var/log/myapp/myapp.log {
- rotate 7
- daily
- size 100MB
- compress
- missingok
- notifempty
- postrotate
- sudo systemctl restart rsyslog.service
- endscript
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement