Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

add the full syslog feature to Nginx

tree: 28b0fee202

Fetching latest commit…

Cannot retrieve the latest commit at this time

README
==INSTALLATION==
    
cd nginx-0.8.54
patch -p1 < /path/to/this/directory/new_syslog_0.8.54.patch

#add the module, New !!!
./configure --add-module=/path/to/this/directory


==EXAMPLE==

worker_processes  1;

syslog local6 nginx;

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. 

Note: if you set the error_log directive in the main block, the syslog is switched on by default.

===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.