Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement