Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ansible/roles/loggly/files/50-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# For more information see rsyslog.conf(5) and /etc/rsyslog.conf

# No buffering
$ActionQueueType Direct

#
# First some standard log files. Log by facility.
#
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/loggly/files/rsyslog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ $KLogPermitNonKernelFacility on
#### GLOBAL DIRECTIVES ####
###########################

#
# Set main message queue to use direct queuing (not queued) mode
#

$MainMsgQueueType Direct

#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/loggly/templates/21-output-syslog.conf.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
$WorkDirectory /var/spool/rsyslog

# Rotate per hour
$ActionQueueType Direct
$template RotateHourly_{{ name }},"{{ app_log_dir }}/%$YEAR%/%$MONTH%/%$DAY%/%$HOUR%/{{ name }}.log"
if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then { action (type="omfile" DynaFile="RotateHourly_{{ name }}" template="RunnableJSON" dirCreateMode="0755" FileCreateMode="0644") }

# Loggly: Add a tag for {{ name }} events
$template LogglyFormat_{{ name }},"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %syslogtagid% [{{ loggly_token }}@41058 tag=\"runnable\" tag=\"{{ node_env }}\"] %syslogtag%\n"
$ActionQueueType LinkedList
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an in-memory queue.

$template LogglyFormat_{{ name }},"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %syslogtag% [{{ loggly_token }}@41058 tag=\"runnable\" tag=\"{{ node_env }}\"] %msg%\n"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no such thing as %syslogtagid%, and we want to send the %msg% not the %syslogtagid% OR the %syslogtag%; this line had been being ignored prior to this change.

if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then @@logs-01.loggly.com:6514;LogglyFormat_{{ name }}
if $syslogtag contains '{{ name }}' and $syslogfacility-text == 'local7' then stop