rsyslog: Configure logging all message to /data/log.
[matthijs/servers/tika.git] / etc / rsyslog.conf
1 #  /etc/rsyslog.conf    Configuration file for rsyslog.
2 #
3 #                       For more information see
4 #                       /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
5
6
7 #################
8 #### MODULES ####
9 #################
10
11 $ModLoad imuxsock # provides support for local system logging
12 $ModLoad immark   # provides --MARK-- message capability
13 $MarkMessagePeriod  900 # mark messages appear every 15 Minutes
14
15 $ModLoad imtcp
16 $InputTCPServerRun 514 # Accept TCP connections on the default syslog port
17
18 ###########################
19 #### GLOBAL DIRECTIVES ####
20 ###########################
21
22 #
23 # Use traditional timestamp format.
24 # To enable high precision timestamps, comment out the following line.
25 #
26 $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
27
28 #
29 # Set the default permissions for all log files.
30 #
31 $FileOwner root
32 $FileGroup adm
33 $FileCreateMode 0640
34 $DirCreateMode 0755
35 $Umask 0022
36
37 #
38 # Include all config files in /etc/rsyslog.d/
39 #
40 $IncludeConfig /etc/rsyslog.d/*.conf
41
42 # Store any queues here. This directory is not created automatically, so it
43 # must already exist!
44 $WorkDirectory /var/spool/rsyslog
45
46 # Use a (disk-assisted) main queue
47 # Use a linked list for queueing
48 $MainMsgQueueType LinkedList
49 # Name to use for the queue file
50 $MainMsgQueueFileName main
51 # save in-memory data if rsyslog shuts down
52 $MainMsgQueueSaveOnShutdown on
53
54 ########################
55 #### Remote logging ####
56 ########################
57
58 # Log lines received from other servers (as well as our own logs) centrally.
59 $template HostFacilityLog,"/data/log/rsyslog/hosts/%fromhost%/facilities/%syslogfacility-text%.log"
60 $template HostSeverityLog,"/data/log/rsyslog/hosts/%fromhost%/severities/%syslogseverity-text%.log"
61 $template HostAppLog,"/data/log/rsyslog/hosts/%fromhost%/apps/%app-name%.log"
62
63 # Use a verbose logging format
64 $template LogFormat, "%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag% %syslogfacility-text%.%syslogseverity-text%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%\n"
65
66 # Log by facility, severity and appname
67 *.*                             ?HostFacilityLog;LogFormat
68 *.*                             ?HostSeverityLog;LogFormat
69 *.*                             ?HostAppLog;LogFormat
70 # Log all entries in a single file, which is meant to be parsed by logcheck
71 # (hence the traditional format).
72 *.*                             -/data/log/rsyslog/all.log;RSYSLOG_TraditionalFileFormat
73
74 # Debugging format. Based on RSYSLOG_DebugFormat, available in later versions
75 # of rsyslogd, with some variations.
76 $template DebugFormat,"Debug line with all properties:\nFROMHOST: '%FROMHOST%', HOSTNAME: '%HOSTNAME%', PRI: %PRI%,\nsyslogtag '%syslogtag%', programname: '%programname%', APP-NAME: '%APP-NAME%', PROCID: '%PROCID%', MSGID: '%MSGID%',\nTIMESTAMP: '%TIMESTAMP%', STRUCTURED-DATA: '%STRUCTURED-DATA%', syslogtag: '%syslogtag%'\nmsg: '%msg%'\nescaped msg: '%msg:::drop-cc%'\nrawmsg: '%rawmsg%'\n\n"
77 # Uncomment this to have detailed logging for debugging
78 #*.*                            -/data/log/rsyslog/debug.log;DebugFormat
79
80 #######################
81 #### Local logging ####
82 #######################
83
84 # Discard all log entries not locally generated (note that the ~ here is the
85 # "discard" action, preventing the rules below from bein ran on these messages.
86 if $fromhost-ip != '127.0.0.1' then ~
87
88
89 # Log each facility into its own log
90 auth,authpriv.*                 /var/log/rsyslog/auth.log
91 cron.*                          -/var/log/rsyslog/user.log
92 daemon.*                        -/var/log/rsyslog/daemon.log
93 kern.*                          -/var/log/rsyslog/kern.log
94 lpr.*                           -/var/log/rsyslog/lpr.log
95 mail.*                          -/var/log/rsyslog/mail.log
96 user.*                          -/var/log/rsyslog/user.log
97 local0,local1,local2,\
98         local3,local4,local5,\
99         local6,local7.*         -/var/log/rsyslog/local.log
100
101 # Omitted facilities: syslog, news, uucp, ftp
102
103 # All logs end up in syslog as weel as the corresponding facility log above
104 # (except for auth, mail which only end up in the facility log for privacy
105 # reasons and debug which only ends up in the debug log below to prevent
106 # flooding).
107 *.*;\
108         *.!=debug;\
109         auth,authpriv.none;\
110         mail.none               -/var/log/rsyslog/syslog
111
112 # Debug entries end up in debug.log as well as the corresponding facility log
113 # above (except for auth and mail, which only end up in the facility logs for
114 # privacy reasons).
115 *.=debug;\
116         auth,authpriv.none;\
117         news.none;mail.none     -/var/log/rsyslog/debug.log
118 #
119 # Emergencies are sent to everybody logged in.
120 #
121 *.emerg                         *