#
# Syslog-ng  configuration for for Debian GNU/Linux
#
# Copyright (c) 1999 anonymous
# Copyright (c) 1999 Balazs Scheidler
# $Id: syslog-ng.conf.sample,v 1.2 1999/11/15 12:30:41 bazsi Exp $
#
# Syslog-ng configuration file, compatible with default Debian syslogd
# installation. 
#

###########################################################
# DEFINE LOGGING OPTIONS 
###########################################################

options { long_hostnames(off); sync(0); };



###########################################################
# DEFINE AVAILABLE LOG SOURCES TO CHOOSE FROM
###########################################################

source src { 
	unix-stream("/dev/log"); 
	unix-stream("/var/chroot/named/dev/log"); 
	internal(); 
};

# Example of listening to additional sockets
## source src { unix-stream("/dev/log"); unix-stream("/home/named/dev/log"); internal(); };
 
# Uncomment on host that is to be network LOGSERVER
## source net { udp(); };



###########################################################
# DEFINE AVAILABLE LOG DESTINATIONS TO CHOOSE FROM
###########################################################

destination authlog { file("/var/log/auth.log"); };
# destination syslog { file("/var/log/syslog"); };
destination syslog { file("/var/log/messages"); };
destination cron { file("/var/log/cron.log"); };
destination kern { file("/var/log/kern.log"); };
destination uucp { file("/var/log/uucp.log"); };
destination mail { file("/var/log/mail.log"); };
destination spooler { file("/var/log/spooler.log"); };
destination sudo { file("/var/log/sudo.log"); };
destination boot { file("/var/log/boot.log"); };
destination debug { file("/var/log/debug.log"); };
destination messages { file("/var/log/messages"); };
destination loginlog { file("/var/log/login.log"); };
destination console { usertty("root"); };
destination console_all { file("/dev/tty12"); };
destination tty8-log { file("/dev/tty8"); };

#### REMOTE HOST TO SEND LOGS TO 
## destination loghost { udp("SOMEREMOTEHOST" port(514)); };

destination xconsole { pipe("/dev/xconsole"); };



###########################################################
# DEFINE AVAILABLE LOG FILTERS TO CHOOSE FROM
###########################################################

# Filters at the "facility" granularity

filter f_auth { facility(auth); };
filter f_authpriv { facility(auth, authpriv); };
filter f_syslog { not facility(authpriv, mail); };
filter f_b-syslog { level(warn) or level(err); };
## filter f_loginlog { facility(auth) or facility(user); };
filter f_loginlog { facility(auth); };
filter f_cron { facility(cron); };
filter f_kern { facility(kern); };
filter f_mail { facility(mail); };
filter f_uucp { facility(uucp); };
filter f_news { facility(news) and level(crit); };
filter f_sudo { facility(local2) and level(debug); };
filter f_boot { facility(local7); };
filter f_tty8 { facility(authpriv, kern) or level(warn, err); };
filter f_lids { match("lids"); };


filter f_messages { level(info, emerg, debug, notice, warn, crit, err); };

#filter f_messages_wo_mail { level(info, emerg, debug, notice, warn, crit, err) not facility(mail); };

# Filters at the "level" granularity

filter f_emergency { level(emerg); };
filter f_debug { level(debug); };
filter f_info { level(info); };
filter f_notice { level(notice); };
filter f_warn { level(warn); };
filter f_crit { level(crit); };
filter f_err { level(err); };




###########################################################
# DEFINE LOGGING - (sources; filters; destinations)
###########################################################

# log restricted access
log { source(src); filter(f_authpriv); destination(authlog); };

## log { source(src); filter(f_syslog); destination(syslog); };
## log { source(src); filter(f_b-syslog); destination(syslog); };

log { source(src); filter(f_mail); destination(mail); };

log { source(src); filter(f_sudo); destination(sudo); };
log { source(src); filter(f_boot); destination(boot); };

log { source(src); filter(f_lids); destination(messages); };

#### Make a copy of messages
log { source(src); filter(f_debug); destination(debug); };

#### Log anything (except mail) of level info or higher.
#### Don't log private authentication messages!
## Use the following line instead on a network LOGSERVER
## log { source(src); source(net); filter(f_messages); destination(messages); };
log { source(src); filter(f_messages); destination(messages); };

##### emergency & critical messages to consoles and /var/log/messages
log { source(src); filter(f_emergency);  \
	destination(messages); destination(console); \
	destination(console_all); destination(xconsole); };
log { source(src); filter(f_crit);  \
	destination(messages); destination(console); \
	destination(console_all); destination(xconsole); };


#### Send a copy of *.info to loghost for REMOTE HOST logging
## log { source(src); filter(f_info); destination(loghost); };

#### log all logins
log { source(src); filter(f_loginlog); destination(loginlog); };

