User Tools

Site Tools


doc:howto:log.syslog-ng

syslog-ng

Installation

# opkg install syslog-ng3

Do not install the syslog-ng package as it is very old and out-of-date.

In Backfire 10.3.1-rc4, there are missing depencies. Install with

# opkg install libdbi

Configuration

Configuration is controlled by /etc/syslog-ng.conf The default configuration logs to /var/log/messages.

Below is a sample configuration for logging to a remote server via UDP (from http://www.systemajik.com/blog/openwrt-syslog-ng-installation/):

options {
    chain_hostnames(off);
    sync(0);
    stats(0);
};

source src { unix-stream("/dlog"); internal(); };
source kernel { file("/proc/kmsg" log_prefix("kernel: ")); };

destination messages { file("/var/log/messages" log_fifo_size(256)); };
destination d_udp { udp("192.168.10.2" port(514)); };

log {
    source(src);
    source(kernel);
    destination(d_udp);
#    destination(messages);
};

Reconfiguration

To apply changes, it is not sufficient to simply restart the syslog-ng daemon. Instead, stop and start the daemon as follows (taken from http://baheyeldin.com/technology/linux/logging-with-syslog-ng-on-openwrt.html):

# killall syslog-ng
# /etc/init.d/syslog-ng start

IPv6 Logserver

To log to a logserver listening on an IPv6 address, use a udp6() destination in the configuration file:

...
destination d_udp6 { udp6("1234:5678:1011:1314::01" port(514)); };
...
log {
    source(src);
    source(kernel);
    destination(d_udp6);
};
...

Startup

# /etc/init.d/syslog-ng enable
# /etc/init.d/syslog-ng start

doc/howto/log.syslog-ng.txt · Last modified: 2015/01/15 08:45 by Despot