diff --git a/util/rsyslog.d/weewx.conf b/util/rsyslog.d/weewx.conf index 86f19b50..d0a4fde5 100644 --- a/util/rsyslog.d/weewx.conf +++ b/util/rsyslog.d/weewx.conf @@ -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 ~