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 ba0e056 commit f5ec5e5
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 17 deletions.
6 changes: 2 additions & 4 deletions SOURCES/haproxy.syslog.amzn1
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
$MaxMessageSize 64k
$FileCreateMode 0600

$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: 1 addition & 3 deletions SOURCES/haproxy.syslog.amzn2
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514
$MaxMessageSize 64k
$FileCreateMode 0600

$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.* /var/log/haproxy/status.log
local2.* stop
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
& ~
15 changes: 11 additions & 4 deletions SOURCES/haproxy.syslog.el7
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ $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
}
15 changes: 11 additions & 4 deletions SOURCES/haproxy.syslog.el8
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ $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
}

0 comments on commit f5ec5e5

Please sign in to comment.