summaryrefslogtreecommitdiff
path: root/meta-ampere/meta-common/recipes-extended/rsyslog/rsyslog/rsyslog.conf
blob: 656f1d3fb1b8e2fefdd00e5ea058361d3605d21c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# if you experience problems, check
# http://www.rsyslog.com/troubleshoot for assistance

# rsyslog v3: load input modules
# If you do not load inputs, nothing happens!
# You may need to set the module load path if modules are not found.
#
# Ported from debian's sysklogd.conf

# Journal-style logging
# Limit to no more than 2000 entries in one minute and enable the
# journal workaround to avoid duplicate entries
module(load="imjournal" StateFile="/var/log/state"
                        RateLimit.Interval="60"
                        RateLimit.Burst="2000")

# Template for Redfish messages
# "<timestamp> <MessageId>,<MessageArgs>"
template(name="RedfishTemplate" type="list") {
    property(name="timereported" dateFormat="rfc3339")
    constant(value=" ")
    property(name="$!REDFISH_MESSAGE_ID")
    constant(value=",")
    property(name="$!REDFISH_MESSAGE_ARGS")
    constant(value="\n")
}

# Template for Application Crashes
# "<timestamp> <MessageId>,<MessageArgs>"
template(name="CrashTemplate" type="list") {
    property(name="timereported" dateFormat="rfc3339")
    constant(value=" ")
    constant(value="OpenBMC.0.1.ServiceFailure")
    constant(value=",")
    property(name="$!UNIT")
    constant(value="\n")
}


# If the journal entry has a Redfish MessageId, save as a Redfish event
if ($!REDFISH_MESSAGE_ID != "") then {
   action(type="omfile" file="/var/log/redfish" template="RedfishTemplate")
}

# If the journal entry has a Exit Code, save as a Redfish event
if ($!EXIT_STATUS != "" and $!EXIT_STATUS != "0") then {
   action(type="omfile" file="/var/log/redfish" template="CrashTemplate")
}

#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf