Advertisement
coombesy

rsyslog - 21-nginx.conf

Oct 20th, 2015
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. $ModLoad imfile
  2. $InputFilePollInterval 10
  3. $WorkDirectory /var/spool/rsyslog
  4.  
  5. # nginx access file:
  6. #$InputFileName /var/log/nginx/access.log
  7. $InputFileName /var/www/vhosts/example.tld/logs/access_log
  8. $InputFileTag nginx-access:
  9. $InputFileStateFile stat-nginx-access
  10. $InputFileSeverity info
  11. $InputFilePersistStateInterval 20000
  12. $InputRunFileMonitor
  13.  
  14. #nginx Error file:
  15. $InputFileName /var/www/vhosts/example.tld/logs/error_log
  16. $InputFileTag nginx-error:
  17. $InputFileStateFile stat-nginx-error
  18. $InputFileSeverity error
  19. $InputFilePersistStateInterval 20000
  20. $InputRunFileMonitor
  21.  
  22. #Add a tag for nginx events
  23. $template LogglyFormatNginx,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [my-token@41058 tag=\"nginx\" ] %msg%\n"
  24.  
  25. if $programname == 'nginx-access' then @@logs-01.loggly.com:514;LogglyFormatNginx
  26. if $programname == 'nginx-access' then ~
  27. if $programname == 'nginx-error' then @@logs-01.loggly.com:514;LogglyFormatNginx
  28. if $programname == 'nginx-error' then ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement