Enable rsyslog journald module and persistent journald

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2016-01-30 23:21:26 +00:00
parent f73f5af48e
commit c9edc339a5
3 changed files with 24 additions and 3 deletions

View file

@ -6,7 +6,8 @@
#### MODULES #### #### MODULES ####
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ModLoad imklog # provides kernel logging support (previously done by rklogd) $ModLoad imjournal # provides access to the systemd journal
#$ModLoad imklog # provides kernel logging support (previously done by rklogd)
#$ModLoad immark # provides --MARK-- message capability #$ModLoad immark # provides --MARK-- message capability
# Provides UDP syslog reception # Provides UDP syslog reception
@ -19,6 +20,7 @@ $ModLoad imklog # provides kernel logging support (previously done by rklogd)
#### GLOBAL DIRECTIVES #### #### GLOBAL DIRECTIVES ####
$WorkDirectory /var/lib/rsyslog
# Use default timestamp format # Use default timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
@ -31,6 +33,13 @@ $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf $IncludeConfig /etc/rsyslog.d/*.conf
# Turn off message reception via local log socket;
# local messages are retrieved through imjournal now.
$OmitLocalLogging on
# File to store the position in the journal
$IMJournalStateFile imjournal.state
#### RULES #### #### RULES ####
# Log all kernel messages to the console. # Log all kernel messages to the console.
@ -52,7 +61,7 @@ mail.* -/var/log/maillog
cron.* /var/log/cron cron.* /var/log/cron
# Everybody gets emergency messages # Everybody gets emergency messages
*.emerg * *.emerg :omusrmsg:*
# Save news errors of level crit and higher in a special file. # Save news errors of level crit and higher in a special file.
uucp,news.crit /var/log/spooler uucp,news.crit /var/log/spooler

View file

@ -17,7 +17,8 @@ $MarkMessagePeriod 1200 # every 20 minutes
$ModLoad imudp.so #udp sockets $ModLoad imudp.so #udp sockets
$ModLoad imtcp.so #tcp socks $ModLoad imtcp.so #tcp socks
$ModLoad imuxsock # local syslog() listener $ModLoad imuxsock # local syslog() listener
$ModLoad imklog # local klog logging #$ModLoad imklog # local klog logging
$ModLoad imjournal # provides access to the systemd journal
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
@ -37,6 +38,8 @@ $InputTCPServerRun 514
$InputTCPServerRun 5000 $InputTCPServerRun 5000
$IMUXSockRateLimitInterval 0 $IMUXSockRateLimitInterval 0
$SystemLogRateLimitInterval 0 $SystemLogRateLimitInterval 0
$WorkDirectory /var/lib/rsyslog
$IMJournalStateFile imjournal.state
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
# T E M P L A T E S # # T E M P L A T E S #

View file

@ -184,6 +184,15 @@
- service - service
- base - base
- name: enable journald persistence
file: path=/var/log/journal state=directory
owner=root group=root mode=0600
when: ansible_distribution_major_version|int == 7
tags:
- journald
- config
- base
- name: rsyslog.conf - name: rsyslog.conf
copy: src={{ item }} dest=/etc/rsyslog.conf mode=644 copy: src={{ item }} dest=/etc/rsyslog.conf mode=644
with_first_found: with_first_found: