note to self: verify problem exists before trying to fix it

bridge from [Logging] to journalctl already exists, obviating rsyslog:
(venv) graham@burner:~/data$ ls -l /dev/log
lrwxrwxrwx 1 root root 28 Aug  4 17:19 /dev/log -> /run/systemd/journal/dev-log
⊣GE⊢

> On 5 Aug 2023, at 2:43 am, Paul R Anderson <p...@pauland.net> 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 <g...@geddy.au 
> <mailto:g...@geddy.au>> 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:
>> copied all the [Logging] section from defaults into weewx.conf
>> change [[root]] handlers = systemd,
>> 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 weewx-development+unsubscr...@googlegroups.com 
>> <mailto:weewx-development+unsubscr...@googlegroups.com>.
>> 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 weewx-development+unsubscr...@googlegroups.com 
> <mailto:weewx-development+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/weewx-development/CAOAVAede6wUFUP%2BTkTXLiN6z_TPUBzzzweWkheMnkEkqrLmrpQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/weewx-development/CAOAVAede6wUFUP%2BTkTXLiN6z_TPUBzzzweWkheMnkEkqrLmrpQ%40mail.gmail.com?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 weewx-development+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-development/82CD2483-69F5-46F6-820D-9F69D6E8DC14%40geddy.au.

Reply via email to