Skip to content

Commit

Permalink
Fix default included syslog entries
Browse files Browse the repository at this point in the history
- Resolved issue with all messages in /var/log/messages missing on CentOS/RHEL 7.x and 8.x
  • Loading branch information
DBezemer committed Apr 21, 2020
1 parent f080758 commit b8daed1
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
4 changes: 2 additions & 2 deletions SOURCES/haproxy.syslog.amzn1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ $template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.=notice;local2.=warning /var/log/haproxy/status.log;HAProxy
local2.error /var/log/haproxy/error.log;HAProxy
local2.* ~
local2.* /var/log/haproxy/status.log
& ~
4 changes: 2 additions & 2 deletions SOURCES/haproxy.syslog.amzn2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ $template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.=notice;local2.=warning /var/log/haproxy/status.log;HAProxy
local2.error /var/log/haproxy/error.log;HAProxy
local2.* stop
local2.* /var/log/haproxy/status.log
& ~
4 changes: 2 additions & 2 deletions SOURCES/haproxy.syslog.el6
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ $template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.=notice;local2.=warning /var/log/haproxy/status.log;HAProxy
local2.error /var/log/haproxy/error.log;HAProxy
local2.* ~
local2.* /var/log/haproxy/status.log
& ~
16 changes: 12 additions & 4 deletions SOURCES/haproxy.syslog.el7
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ $UDPServerRun 514
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info if $programname startswith 'haproxy' then /var/log/haproxy/access.log;HAProxyAccess
local2.emerg if $programname startswith 'haproxy' then /var/log/haproxy/error.log;HAProxy
local2.notice if $programname startswith 'haproxy' then /var/log/haproxy/status.log;HAProxy
local2.* & stop
if $programname startswith 'haproxy' then {
if $syslogseverity == 6 then
action(type="omfile" file="/var/log/haproxy/access.log" template="HAProxyAccess")
stop
if $syslogseverity <= 3 then
action(type="omfile" file="/var/log/haproxy/error.log" template="HAProxy")
stop
if $syslogseverity <= 5 then
action(type="omfile" file="/var/log/haproxy/status.log" template="HAProxy")
stop
} else
action(type="omfile" file="/var/log/messages")
16 changes: 12 additions & 4 deletions SOURCES/haproxy.syslog.el8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ $UDPServerRun 514
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info if $programname startswith 'haproxy' then /var/log/haproxy/access.log;HAProxyAccess
local2.emerg if $programname startswith 'haproxy' then /var/log/haproxy/error.log;HAProxy
local2.notice if $programname startswith 'haproxy' then /var/log/haproxy/status.log;HAProxy
local2.* & stop
if $programname startswith 'haproxy' then {
if $syslogseverity == 6 then
action(type="omfile" file="/var/log/haproxy/access.log" template="HAProxyAccess")
stop
if $syslogseverity <= 3 then
action(type="omfile" file="/var/log/haproxy/error.log" template="HAProxy")
stop
if $syslogseverity <= 5 then
action(type="omfile" file="/var/log/haproxy/status.log" template="HAProxy")
stop
} else
action(type="omfile" file="/var/log/messages")

0 comments on commit b8daed1

Please sign in to comment.