瀏覽代碼

Handle nginx logs

Bob Mottram 8 年之前
父節點
當前提交
c3fe06a66b
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      src/freedombone-logging

+ 4
- 0
src/freedombone-logging 查看文件

@@ -63,6 +63,8 @@ if [[ "$1" == "on" || "$1" == "On" || "$1" == "ON" ]]; then
63 63
             sed -i "s|access_log.*|access_log /var/log/nginx/$filename_domain.access.log;|g" $filename
64 64
             sed -i "s|error_log.*|error_log /var/log/nginx/$filename_domain.err.log $WEBSERVER_LOG_LEVEL;|g" $filename
65 65
         done
66
+        sed -i 's|access_log.*|access_log = /var/log/nginx/access.log;|g' /etc/nginx/nginx.conf
67
+        sed -i 's|error_log.*|error_log = /var/log/nginx/error.log;|g' /etc/nginx/nginx.conf
66 68
     fi
67 69
     if [ -f /etc/init.d/spamassassin ]; then
68 70
         sed -i 's|DOPTIONS="-s null -d --pidfile=$PIDFILE"|DOPTIONS="-d --pidfile=$PIDFILE"|g' /etc/init.d/spamassassin
@@ -120,6 +122,8 @@ else
120 122
             sed -i 's|warn_log.*|warn_log /dev/null;|g' $filename
121 123
             sed -i 's|error_log.*|error_log /dev/null;|g' $filename
122 124
         done
125
+        sed -i 's|access_log.*|access_log = /dev/null;|g' /etc/nginx/nginx.conf
126
+        sed -i 's|error_log.*|error_log = /dev/null;|g' /etc/nginx/nginx.conf
123 127
         shred -zu /var/log/nginx/*
124 128
     fi
125 129
     if [ -f /etc/init.d/spamassassin ]; then