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 45d4bfe commit 517cd72
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
11 changes: 11 additions & 0 deletions SOURCES/haproxy.syslog.amzn1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.error /var/log/haproxy/error.log;HAProxy
local2.* /var/log/haproxy/status.log
& ~
11 changes: 11 additions & 0 deletions SOURCES/haproxy.syslog.amzn2
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxyAccess
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
}

0 comments on commit 517cd72

Please sign in to comment.