syslog-ng.conf 2 KB
Newer Older
1
2
3
4
5
6
#############################################################################
# OpenWrt syslog-ng.conf specific file
# which collects all local logs into a single file called /var/log/messages.
# More details about these settings can be found here:
# https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.16/release-notes/global-options

7
@version: 3.21
8
9
@include "scl.conf"
@include "/etc/syslog-ng.d/" # Put any customization files in this directory
blogic's avatar
blogic committed
10
11

options {
12
13
14
15
16
17
18
19
	chain_hostnames(no); # Enable or disable the chained hostname format.
	create_dirs(yes);
	keep_hostname(yes); # Enable or disable hostname rewriting.
	log_fifo_size(256); # The number of messages that the output queue can store.
	log_msg_size(1024); # Maximum length of a message in bytes.
	stats_freq(0); # The period between two STATS messages (sent by syslog-ng, containing statistics about dropped logs) in seconds.
	flush_lines(0); # How many lines are flushed to a destination at a time.
	use_fqdn(no); # Add Fully Qualified Domain Name instead of short hostname.
blogic's avatar
blogic committed
20
21
22
23
};

source src {
	internal();
24
	unix-stream("/dev/log" flags("expect-hostname"));
blogic's avatar
blogic committed
25
26
27
28
29
30
};

source kernel {
        file("/proc/kmsg" program_override("kernel"));
};

31
32
33
34
35

source net {
        udp(ip(0.0.0.0) port(514));
};

36
37
38
39
40
41
42
43
44
45
46
47
48
source s_network {
	default-network-drivers(
		# NOTE: TLS support
		#
		# the default-network-drivers() source driver opens the TLS
		# enabled ports as well, however without an actual key/cert
		# pair they will not operate and syslog-ng would display a
		# warning at startup.
		#
		#tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert"))
	);
};

49
filter f_turris_iptables {
50
	not match(".*turris[^:]*: .*" value(MESSAGE) type("posix")) or not level(debug);
51
52
};

blogic's avatar
blogic committed
53
destination messages {
54
	file("/var/log/messages" suppress(5) template("${R_YEAR}-${R_MONTH}-${R_DAY} ${R_HOUR}:${R_MIN}:${R_SEC} ${PRIORITY} ${PROGRAM}[${PID}]: ${MSGONLY}\n") log_fifo_size(256));
blogic's avatar
blogic committed
55
56
57
58
};

log {
	source(src);
59
60
	source(kernel);
	filter(f_turris_iptables);
blogic's avatar
blogic committed
61
62
	destination(messages);
};