Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
Free

Free

1 site, unlimited servers No source distribution Non-commercial use only
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Aug 8, 2012
    Last Update: Aug 6, 2012
  • Language: C/C++
  • Category: Performance
  • Time / costs savings: 100h / $6000 *

nginx socketlog module

nginx socketlog module
Developed by Valery Kholodkov, Released Aug 8, 2012

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

C/C++

Tags: bsd syslog , log , logging , nginx

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.

Back to top

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;

Back to top

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
Back to top

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;
        }
    }
}
Back to top

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;

User Reviews

No reviews have been submitted yet.

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.