Skip to content
add the full syslog feature to Nginx
Perl
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README
syslog_0.7.67.patch

README

==INSTALLATION==
    
cd nginx-0.7.67
patch -p1 < /path/to/this/directory/syslog_0.7.67.patch

OR

cd nginx-0.8.50
patch -p1 < /path/to/this/directory/syslog_0.8.50.patch


==EXAMPLE==

worker_processes  1;

syslog local6;

events {
        worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] $request '
        '"$status" $body_bytes_sent "$http_referer" '
        '"$http_user_agent" "$http_x_forwarded_for"';

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        access_log  syslog:notice|logs/host1.access.log main;
        error_log syslog:notice|logs/host1.error.log;

        location / {
            root   html;
            index  index.html index.htm;
        }
    }

    server {
        listen       80;
        server_name  www.example.com;

        access_log  syslog:warn|logs/host2.access.log main;
        error_log syslog:warn|logs/host2.error.log;

        location / {
            root   html;
            index  index.html index.htm;
        }
    }
}


==DIRECTIVES==

===SYSLOG===
Sytax: syslog auth|authpriv|cron|daemon|ftp|kern|local0-7|lpr|mail|news|syslog|user|uucp [program_name]
Default: none
Context: main

Enable the syslog and set its facility. The default program name is nginx.

===ERROR_LOG===
Syntax: error_log [syslog[:emerg|alert|crit|error|warn|notice|info|debug]]['|'file] [ debug | info | notice | warn | error | crit ]
Default: ${prefix}/logs/error.log
Context: main, http, server, location

Enable the error_log with the syslog and set its priority. The default priority is error. 

===ACCESS_LOG===
Syntax: access_log off|[syslog[:emerg|alert|crit|error|warn|notice|info|debug]]['|'path] [format [buffer=size]]]
Default: access_log logs/access.log combined
Context: http, server, location

Enable the access_log with the syslog and set its priority. The default priority is notice. 


==CONTACT==
Reporting a bug
Questions/patches may be directed to Weibin Yao, yaoweibin@gmail.com.

Something went wrong with that request. Please try again.