mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 16:46:56 -04:00
Resolves #788 adding rsyslog example for CentOS journal.
This commit is contained in:
@@ -1,17 +1,45 @@
|
||||
# use old-style syntax for rsyslog, since it will work everywhere
|
||||
#
|
||||
# Configuration options for rsyslog / log handling
|
||||
#
|
||||
# Default to old-style Property-Based Filters syntax for rsyslog
|
||||
:programname,isequal,"weewx" /var/log/weewx.log
|
||||
:programname,isequal,"weewx" stop
|
||||
:programname,startswith,"wee_" /var/log/weewx.log
|
||||
:programname,startswith,"wee_" stop
|
||||
|
||||
# this is the old syntax (pre v6, still supported post v6)
|
||||
##
|
||||
## EXAMPLE 1:
|
||||
## Rsyslog 'RainerScript' full syntax with multiple conditions
|
||||
## 'RainerScript' has replaced the BSD syntax, but both are supported.
|
||||
## Basic if...else support since v5, fully supported since v6
|
||||
##
|
||||
#if ($programname == "weewx" or $programname startswith "wee_") then {
|
||||
# /var/log/weewx.log
|
||||
# stop
|
||||
#}
|
||||
## Handle weewx utils in RHEL / Centos where logs are written through journal
|
||||
#if ($programname == "journal" and $msg contains 'wee_') then {
|
||||
# /var/log/weewx.log
|
||||
# stop
|
||||
#}
|
||||
|
||||
#
|
||||
# EXAMPLE 2:
|
||||
# A more basic 'RainerScript' syntax
|
||||
#
|
||||
#if $programname == 'weewx' then /var/log/weewx.log
|
||||
#if $programname == 'weewx' then stop
|
||||
#if $programname startswith 'wee_' then /var/log/weewx.log
|
||||
#if $programname startswith 'wee_' then stop
|
||||
## Handle weewx utils in RHEL / Centos where logs are written through journal
|
||||
#if $programname == 'journal' and $msg startswith 'wee_' then /var/log/weewx.log
|
||||
#if $programname == 'journal' and $msg startswith 'wee_' then stop
|
||||
|
||||
#
|
||||
# EXAMPLE 3 - deprecated:
|
||||
# The tilde "~" discard action is deprecated, but supported, since v6
|
||||
#
|
||||
#:programname,isequal,"weewx" /var/log/weewx.log
|
||||
#:programname,isequal,"weewx" ~
|
||||
#:programname,startswith,"wee_" /var/log/weewx.log
|
||||
#:programname,startswith,"wee_" ~
|
||||
|
||||
# this is the new 'RainerScript' syntax (if...else since v5, fully since v6)
|
||||
#if $programname == 'weewx' then /var/log/weewx.log
|
||||
#if $programname == 'weewx' then ~
|
||||
#if $programname startswith 'wee_' then /var/log/weewx.log
|
||||
#if $programname startswith 'wee_' then ~
|
||||
|
||||
Reference in New Issue
Block a user