From: Jeremy Tan Date: Sun, 22 Sep 2013 00:42:13 +0000 (+0800) Subject: Update nginx/rsyslog config to add specific log for LOGWARN or above X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3b075e3cade9dcd625fab07a713856f657bb2230;hp=--cc;p=matches%2FMCTX3420.git Update nginx/rsyslog config to add specific log for LOGWARN or above --- 3b075e3cade9dcd625fab07a713856f657bb2230 diff --git a/server-configs/nginx/sites-enabled/mctxconfig b/server-configs/nginx/sites-enabled/mctxconfig index 1491152..82d972a 100644 --- a/server-configs/nginx/sites-enabled/mctxconfig +++ b/server-configs/nginx/sites-enabled/mctxconfig @@ -2,7 +2,7 @@ server { listen 80; #Change this to match your root directory - root /usr/share/nginx/html; + root /usr/share/nginx/www; index index.php index.html index.htm; # Make site accessible from http://localhost/ @@ -70,6 +70,12 @@ server { default_type text/plain; } + #Program error log + location ^~ /api/errorlog { + alias /var/log/mctxserv-error.log; + default_type text/plain; + } + location ~ ^/api/?([^?]*) { fastcgi_pass 127.0.0.1:9005; fastcgi_param DOCUMENT_URI_LOCAL $1; diff --git a/server-configs/rsyslog.d/30-mctxserv.conf b/server-configs/rsyslog.d/30-mctxserv.conf index ff4b097..c3150b4 100644 --- a/server-configs/rsyslog.d/30-mctxserv.conf +++ b/server-configs/rsyslog.d/30-mctxserv.conf @@ -1,3 +1,4 @@ $FileCreateMode 0644 if $programname == 'mctxserv' then /var/log/mctxserv.log +if $programname == 'mctxserv' and $syslogseverity <= 4 then /var/log/mctxserv-error.log $FileCreateMode 0640