NGINX and Syslog-NG

For the test I use Syslog-NG version 3.3 and Nginx 1.6 as setup in my previous post.

From version 1.7 Nginx has built in support for sysloging but since my version is 1.6 I use this technique found somewhere on the net with my modifications.

Setup is simple just add the following lines to the syslog-ng.conf file:

source nginx_error_var { program("tail -F -n0 /var/log/nginx/error.log" program_override(nginx)); };
log {
 source(nginx_error_var);
 destination(d_mysql);
 };

and restart syslog-ng (service syslog-ng restart)

The only downside is that some lines might be missed but it works great and does what I want it to do.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

11 − 11 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.