syslog-ng on OpenWrt

Install:

opkg install syslog-ng

Config:

vi /etc/syslog-ng/syslog-ng.conf

Sample (log to remote server):

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

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

destination d_udp { udp("192.168.1.214" port(514)); };

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

Check and enable syslog-ng:

/etc/init.d/syslog-ng enable

Start syslog-ng:

/etc/init.d/syslog-ng start

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s