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

Backport from master
  • Loading branch information
DBezemer committed Apr 21, 2020
1 parent 10dd4df commit a6f2255
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 23 deletions.
12 changes: 6 additions & 6 deletions SOURCES/haproxy.syslog.amzn1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ $ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n"
$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n"
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxy
local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI
local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI
local2.* ~
local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.error /var/log/haproxy/error.log;HAProxy
local2.* /var/log/haproxy/status.log
& ~
10 changes: 5 additions & 5 deletions SOURCES/haproxy.syslog.amzn2
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ $ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n"
$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n"
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxy
local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI
local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI
local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.error /var/log/haproxy/error.log;HAProxy
local2.* /var/log/haproxy/status.log
local2.* stop
12 changes: 6 additions & 6 deletions SOURCES/haproxy.syslog.el6
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ $ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n"
$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n"
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxy
local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI
local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI
local2.* ~
local2.=info /var/log/haproxy/access.log;HAProxyAccess
local2.error /var/log/haproxy/error.log;HAProxy
local2.* /var/log/haproxy/status.log
& ~
19 changes: 13 additions & 6 deletions SOURCES/haproxy.syslog.el7
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ $ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

$template HAProxy,"%syslogtag%%msg:::drop-last-lf%\n"
$template TraditionalFormatWithPRI,"%pri-text%: %timegenerated% %syslogtag%%msg:::drop-last-lf%\n"
$template HAProxy,"%TIMESTAMP% %syslogseverity-text:::UPPERCASE%: %msg:::drop-last-lf%\n"
$template HAProxyAccess,"%msg%\n"

local2.=info /var/log/haproxy/access.log;HAProxy
local2.=notice;local2.=warning /var/log/haproxy/status.log;TraditionalFormatWithPRI
local2.error /var/log/haproxy/error.log;TraditionalFormatWithPRI
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 a6f2255

Please sign in to comment.