Separate weewx.log file -- instructions/suggestions all over the place

225 views
Skip to first unread message

messyp...@gmail.com

unread,
Jul 6, 2023, 5:28:51 PM7/6/23
to weewx-user
Someone who knows this, please help.
I want a separate /var/log/weewx.log file for whatever level of logging I settle upon.
I've followed some procedures which appeared straighfwd but are obviously outdated for the weewx/install method/debian version/  or something. (I got errors like 'not writing through dangling symlink!')
Look, here is what I've got: RPI4b running latest, updated Bullseye (headless); weewx 4.9.1 installed with setup.py.
Everything working great except getting the right instructions to make the separate weewx.log file.  

weewx 4.9.1      setup.py        raspberrypi 4b running debian bullseye regular headless install

THANK YOU

messyp...@gmail.com

unread,
Jul 6, 2023, 5:56:00 PM7/6/23
to weewx-user
Well.. I deleted weewx.conf and this time it didn't complain. stopped/started rsyslog...no complaints.  Started weewx now, and it did a lot of catching up logging to weewxd.log; there is no weewx.log.  Not sure what I did . If someone knows and wants to explain it to me I'll look it up and say thank you.

"MP"

vince

unread,
Jul 6, 2023, 9:46:07 PM7/6/23
to weewx-user
Impossible to know what you did from your skeletal description, but this worked for me on debian12 using the beta of v5 pip.
Be careful in the first step to wget the file and output to something 'other' than weewx.conf to protect yourself from accidentally overwriting your actual weewx config file.   As long as the file in /etc/rsyslog.d ends in .conf it will work.



messyp...@gmail.com

unread,
Aug 16, 2023, 1:00:20 PM8/16/23
to weewx-user
"sudo systemctl restart rsyslogd"  ... there is no process rsyslogd. There is a rsyslog. restarted that, but not working. I really don't want to have to take a short course on darned system logging for my new ubuntu 22.04 running on a orangepi5b. Oh well.
Thanks for trying to help. 

messyp...@gmail.com

unread,
Aug 16, 2023, 2:36:54 PM8/16/23
to weewx-user
Followed the instr above and while it's probably the best so far, my current server, Linux OPI5B 5.10.110-rockchip-rk3588 #1.0.2 SMP Thu Apr 13 16:55:55 CST 2023 aarch64 aarch64 aarch64 GNU/Linux, running ubuntu jammy server (22.04), is up to date and I've been reading that the system maintainers have changed the security on logrotate and even following the instructions logrotate complained and wouldn't rotate until I set tighter security on /var/log.  Currently the default user has to sudo to view syslog, and I changed that by adding myself to the adm group. But there are other problems that needed tightening up.
So when someone says something like "logs are a problem with the operating system and are outside weewx" (something like that), they're right. PITA.
Thanks.
Here are the links I read up on this about:
(I think my problems were solved, at least on this install, by issuing "sudo chmod 755 -R /var/log")

jterr...@gmail.com

unread,
Aug 17, 2023, 2:13:22 AM8/17/23
to weewx-user
On my side,  I configured  a separate log file (/var/log/weewx.conf) and rotation by simply adding a [Logging] stanza in weewx.conf file - see https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging - without changing anything else in the OS logging configuration.

Here is the stanza I use :

[Logging]
    version = 1
    disable_existing_loggers = False
   
    # Root logger
    [[root]]
        level = {log_level}
        handlers = rotate,
   
    # Additional loggers would go in the following section. This is useful for tailoring logging
    # for individual modules.
    [[loggers]]
   
    # Definitions of possible logging destinations
    [[handlers]]
       
        # Log to a set of rotating files    
        [[[rotate]]]
            level = DEBUG
            formatter = verbose
            class = logging.handlers.RotatingFileHandler
            filename = /var/log/weewx.log
            maxBytes = 10000000
            backupCount = 4
       
        # Log to console
        [[[console]]]
            level = DEBUG
            formatter = verbose
            class = logging.StreamHandler
            # Alternate choice is 'ext://sys.stderr'
            stream = ext://sys.stdout
   
    # How to format log messages
    [[formatters]]
        [[[simple]]]
            format = %(levelname)s %(message)s
        [[[standard]]]
            format = {process_name}[%(process)d] %(levelname)s %(name)s: %(message)s
        [[[verbose]]]
            format = %(asctime)s  {process_name}[%(process)d] %(levelname)s %(name)s: %(message)s
            # Format to use for dates and times:
            datefmt = %Y-%m-%d %H:%M:%S

Warren Gill

unread,
Aug 17, 2023, 2:48:17 PM8/17/23
to weewx...@googlegroups.com
I just skip all that and use:
journalctl -xe -u weewx

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b325f86f-f6b3-4ee7-8d7e-8035c921c674n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages