SHARE
TWEET

Untitled

a guest Jun 25th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if $programname == 'myapp' then {
  2.     /var/log/myapp/myapp.log
  3.     stop
  4. }
  5.      
  6. [Unit]
  7. Description=myapp
  8.  
  9. [Service]
  10. User=myapp
  11. ExecStart=/usr/bin/myapp
  12. StandardOutput=syslog
  13. StandardError=syslog
  14. SyslogIdentifier=myapp
  15.  
  16. [Install]
  17. WantedBy=multi-user.target
  18.      
  19. /var/log/myapp/myapp.log {
  20.   rotate 7
  21.   daily
  22.   size 100MB
  23.   compress
  24.   missingok
  25.   notifempty
  26.   postrotate
  27.     sudo systemctl restart rsyslog.service
  28.   endscript
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top