nginx socketlog module

nginx socketlog module

Released 2 years ago , Last update 2 years ago

An nginx module for logging http requests via TCP into syslog servers.

This is a high-performance nginx module for logging http requests via TCP into syslog.

Ever wanted to centralize your log files on one machine or organize your logfiles better? This module is for you!

Smooth integration of this module with nginx server gives the best performance possible. This module links together a fast web server with a well-know and verified logging server.

Main advantages of this module:

  • you can define multiple log destinations (syslog servers)
  • restarting nginx in order to rotate logs is not required anymore!

The module keeps persistent connections to syslog servers and reconnecting if necessary. Once the connection is dropped, the module accumulates log messages in a queue. Once the connection goes up again, the modules flushed accumulated data into the servers. This means that you can restart logging server, without worrying about nginx!

The module keeps persistant connections to BSD syslog servers, reconnecting if necessary.

Developed and tested with nginx version 1.3.x, might work with earlier as well.

4.0
  • 5 0
  • 4 1
  • 3 0
  • 2 0
  • 1 0
1 Reviews Read Reviews

Pricing

FREE

Free

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Non-commercial use

Configuration directives

syntax: socketlog <peer name> <hostname>[:<port>]

default: none

severity: mandatory

context: main configuration file

Specifies the name of a log peer and it's BSD syslog hostname. Once specified, the peer name can be used in access_socketlog directives described below. hostname can be both domain name and IP address of a destination BSD syslog host. Syslog server must listen on TCP port 514 of this host.

syntax: access_socketlog *<off>|<peer name>* *[<log format>* *[bare]]*

default: none

severity: optional

context: http, server, location

Enables or disables logging into specified socketlog peer. Once enabled at certain level, same logging settings are inherited by subsequent levels. off argument disables logging into socket for specific location. Multiple peers are allowed at the same location. Log messages are then sent into all specified peers. bare specifies that no BSD syslog header must be used.

Example: access_socketlog test combined bare;

Installation instructions

How to use

Download sources and unpack the archive:

$ unzip nginx-socketlog-module-1.0.0.zip

Configure nginx with additional module:

cd [path to nginx installation]
./configure --add-module=[path to socketlog module]
make
make install

Example configuration file

error_log  logs/error.log  debug;

events {
    worker_connections  1024;
}

socketlog test localhost;

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

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        access_socketlog test;

        location /no_logging {
            access_socketlog off;
        }
    }
}

Configuration directives

socketlog

syntax: socketlog <peer name> <hostname>[:<port>]

default: none

severity: mandatory

context: main configuration file

Specifies the name of a log peer and it's BSD syslog hostname. Once specified, the peer name can be used in access_socketlog directives described below. hostname can be both domain name and IP address of a destination BSD syslog host. Syslog server must listen on TCP port 514 of this host.

access_socketlog

syntax: access_socketlog *<off>|<peer name>* *[<log format>* *[bare]]*

default: none

severity: optional

context: http, server, location

Enables or disables logging into specified socketlog peer. Once enabled at certain level, same logging settings are inherited by subsequent levels. off argument disables logging into socket for specific location. Multiple peers are allowed at the same location. Log messages are then sent into all specified peers. bare specifies that no BSD syslog header must be used.

Example: access_socketlog test combined bare;

License » Free Download

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
No comments have been posted yet.