# syslog-ng configuration file.
#
# This should behave pretty much like the original syslog on RedHat. But
# it could be configured a lot smarter.
#
# See syslog-ng(8) and syslog-ng.conf(5) for more information.
#

# Options

options {
	sync (0);
	time_reopen (10);
	log_fifo_size (1000);
	long_hostnames (off);
	use_dns (no);
	use_fqdn (no);
	create_dirs (no);
	keep_hostname (yes);
};
###########################################################

# Sources

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

# Filters

filter f_messages { level(info..emerg); };
filter f_secure { facility(authpriv); };
filter f_mail { facility(mail); };
filter f_cron { facility(cron); };
filter f_emerg { level(emerg); };
filter f_spooler { level(crit..emerg) and facility(uucp, news); };
filter f_local7 { facility(local7); };
###########################################################

# Destinations

destination d_messages { file("/var/log/messages"); };
destination d_secure { file("/var/log/secure"); };
destination d_maillog { file("/var/log/maillog"); };
destination d_cron { file("/var/log/cron"); };
destination d_console { usertty("root"); };
destination d_spooler { file("/var/log/spooler"); };
destination d_bootlog { file("/var/log/boot.log"); };

destination loghost { tcp("192.168.56.101" port(514)); };
###########################################################

## Logs
# Send to loghost
log { source(s_sys);  destination(loghost); };

log { source(s_sys); filter(f_emerg); destination(d_console); };
log { source(s_sys); filter(f_secure); destination(d_secure); flags(final); };
log { source(s_sys); filter(f_mail); destination(d_maillog); flags(final); };
log { source(s_sys); filter(f_cron); destination(d_cron); flags(final); };
log { source(s_sys); filter(f_spooler); destination(d_spooler); };
log { source(s_sys); filter(f_local7); destination(d_bootlog); };
log { source(s_sys); filter(f_messages); destination(d_messages); };
###########################################################