Just a follow up Under Debian Bullseye, and many releases prior to that
many of us would follow the classic steps in the WeeWX Wiki of setting up
rsyslog and logrotate, to save WeeWX log messages to a separate file. But
under the hood Debian Bullseye, and many releases prior to that, altho
rsyslog was installed by default, the systemd journal was configured to do
logging and forward the log messages to rsyslog.
So if you followed the steps to log to the classic /var/log/weewx.log file,
in addition to that systemd journalctl was logging WeeWX activity to system
journal as well. Essentially doing redundant logging to 2 locations . So
you could either read the text based log file , or use journalctl tool to
read the log from systemd journal.

Change in Bookworm is that rsyslog is not installed by default. So logging
is only done to systemd journal unless you choose to install rsyslog.
Main drive behind this has been stated to eliminate redundant logging.

Paul


On Fri, Aug 4, 2023 at 12:43 PM Paul R Anderson <[email protected]> wrote:

> Not sure I understand the extra work needed to get logging with WeeWx V5
> under Bookworm to work as you want. I have been  running the alpha
> versions, then the beta versions of V5 under Bookworm for several months,
> starting before Bookworm was released. Using the pip-install of WeeWX
> under Bookworm systemd journalctl logging has been working fine with no
> special work on my part to logging as far as modifying handlers and such. I
> am able to use:
> journalctl -f -u weewx
> to follow the logging as you would with  tail -f /var/log/weewx.log
> Similar to your journalct query but using the  -u --unit=UNIT option
> rather than the -t --identifier=STRING
> Added  alias f="journalctl -f -u " to my .bashrc so I can start weewx and
> follow the log:
> sudo systemctl start weewx;f weewx
> Also ran a bash script daily that captures info on WeeWx and use a  query
> like this to get yesterday's info in what i'm interested in
> ERRORS="journalctl -q -u weewx.service --since yesterday --until today -g
> 'ERROR' "
> thanks
> Paul
>
>
>
> On Fri, Aug 4, 2023 at 11:50 AM Graham Eddy <[email protected]> wrote:
>
>> i have been playing with debian bookworm, where rsyslog is no longer in
>> the core and has to be installed (if you use it). i would describe that as
>> a ’new’ dependency for weewx under debian
>>
>> the weewx 5.0 re-packaging looks awesome - i have now tried pip-installing
>> it under bookworm
>>
>> i have also been playing with systemd journalctl, which is now core to
>> debian bookworm. i know there are systemd haters, but there it is. so for
>> those users who will want to use the standard operational environment, we
>> need a bridge from weewx [Logging] into journalctl, given rsyslog will
>> continue to be the logging engine within weewx
>>
>> there is class systemd.journal.JournalHandler that can be used under
>> [Logging]. it is an external module, not (yet?) part of the
>> logging.handlers module. i tried to pip a couple of pypy modules (systemd
>> and systems-python) but both have install issues. so i have tried apt
>> install python3-systemd, updated env/pyenv.cfg to include external
>> packages, then updated weewx.conf as follows:
>>
>>    1. copied all the [Logging] section from defaults into weewx.conf
>>    2. change [[root]] handlers = systemd,
>>    3. add [[handlers]] [[[systemd]]]
>>      level = DEBUG
>>      formatter = verbose
>>      class = systemd.journal.JournalHandler
>>      SYSLOG_IDENTIFIER = weewx
>>
>> i had to add the SYSLOG_IDENTIFIER because the JournalHandler defaults to
>> using the whole path of weewxd as the logging ident not just the basename
>>
>> then journalctl can be run as usual, using -t to select just weewx
>> entries e.g. journalctl -t weewx -f is equiv to tail -f
>> /var/log/weewx.log.
>> cheers
>> *⊣GE⊢*
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "weewx-development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-development/9A2E99D1-0665-4B18-B215-4911050396B9%40geddy.au
>> <https://groups.google.com/d/msgid/weewx-development/9A2E99D1-0665-4B18-B215-4911050396B9%40geddy.au?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/CAOAVAed8oD%2BLiikBc-OzigLTTsQKsoO56aOz%2BdViCaKrZmG5ug%40mail.gmail.com.

Reply via email to