Is there a way to suppress LOOP entries in the stdout from WeeWX?

270 views
Skip to first unread message

Doug Jenkins

unread,
Mar 27, 2022, 7:24:17 AM3/27/22
to weewx-user
Good Morning:

I am preparing a docker image for my new weatherstation. I am configuring WeeWX the "docker way" where the log data in being written to the stdout via logging handlers.

When I run WeeWX (both in a docker container and on a VM itself), I always see the LOOP output written to stdout. While this is helpful for configuration, I want to suppress this via a configuration setting.

Is there a way to suppress the LOOP data?

Please refer to the LOG SNIPPET and the WeeWX.conf section below for details.

# ========START LOG SNIPPET =============
weewx[1] INFO __main__: Initializing weewx version 4.7.0
weewx[1] INFO __main__: Using Python 3.10.4 (main, Mar 24 2022, 23:15:59) [GCC 10.2.1 20210110]
weewx[1] INFO __main__: Platform Linux-4.19.128-microsoft-standard-x86_64-with-glibc2.31
weewx[1] INFO __main__: Locale is 'C.UTF-8'
weewx[1] INFO __main__: Using configuration file /home/weewx/weewx.conf
weewx[1] INFO __main__: Debug is 0
weewx[1] INFO weewx.engine: Loading station type Simulator (weewx.drivers.simulator)
weewx[1] INFO weewx.engine: StdConvert target unit is 0x1
weewx[1] INFO weewx.wxservices: StdWXCalculate will use data binding wx_binding
weewx[1] INFO weewx.manager: Created and initialized table 'archive' in database 'weewx.sdb'
weewx[1] INFO weewx.manager: Created daily summary tables
weewx[1] INFO weewx.engine: Archive will use data binding wx_binding
weewx[1] INFO weewx.engine: Record generation will be attempted in 'hardware'
weewx[1] INFO weewx.engine: Using archive interval of 60 seconds (specified in weewx configuration)
weewx[1] INFO weewx.restx: StationRegistry: Registration not requested.
weewx[1] INFO weewx.restx: Wunderground: Posting not enabled.
weewx[1] INFO weewx.restx: PWSweather: Posting not enabled.
weewx[1] INFO weewx.restx: CWOP: Posting not enabled.
weewx[1] INFO weewx.restx: WOW: Posting not enabled.
weewx[1] INFO weewx.restx: AWEKAS: Posting not enabled.
weewx[1] INFO weewx.engine: 'pyephem' detected, extended almanac data is available
weewx[1] INFO __main__: Starting up weewx version 4.7.0
weewx[1] INFO weewx.engine: Clock error is -0.05 seconds (positive is fast)
weewx[1] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
weewx[1] INFO weewx.manager: Starting backfill of daily summaries
weewx[1] INFO weewx.manager: Empty database
weewx[1] INFO weewx.engine: Starting main packet loop.
LOOP:   2022-03-27 07:17:24 EDT (1648379844) 'altimeter': '31.15866069654221', 'appTemp': '28.46010918752483', 'barometer': '31.099999998967093', 'cloudbase': '1294.323176426526', 'consBatteryVoltage': '12.0', 'dateTime': '1648379844', 'dewpoint': '27.203560993945757', 'ET': 'None', 'heatindex': '32.67858297022247', 'heatingVoltage': '10.964725663844588', 'humidex': '32.67858297022247', 'inDewpoint': '31.079533828013187', 'inHumidity': '29.999999958683617', 'inTemp': '63.00000002065819', 'inTempBatteryStatus': '0', 'maxSolarRad': '1068.3866207089147', 'outHumidity': '79.99999996901272', 'outTemp': '32.67858297022247', 'outTempBatteryStatus': '0', 'pressure': '31.099999998967093', 'radiation': '109.693874983191', 'rain': '0', 'rainBatteryStatus': '0', 'rainRate': '0.0', 'referenceVoltage': '10.946701975973381', 'rxCheckPercent': '64.8412332946774', 'supplyVoltage': '12.774749615929705', 'txBatteryStatus': '0', 'usUnits': '1', 'UV': '1.5357142497646739', 'windBatteryStatus': '0', 'windchill': '32.67858297022247', 'windDir': '359.9999998140763', 'windGust': '6.197456769996279e-09', 'windGustDir': '359.9999998140763', 'windrun': 'None', 'windSpeed': '5.164547900449179e-09'

# ===== END LOG SNIPPET =====

# ==== START WEEWX.CONF LOG CONFIGURATION =====
# Do not modify this. It is used when installing and updating weewx.
version = 4.7.0

##### LOGGING CONFIGURATION #####
[Logging]
    version = 1
    disable_existing_loggers = False

    # Root logger
    [[root]]
      level = {log_level}
      handlers = console,
   
    # 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 = standard
            class = logging.handlers.RotatingFileHandler
            filename = /var/log/weewx.log
            maxBytes = 10000000
            backupCount = 4

        # Log to console
        [[[console]]]
            level = INFO
            formatter = standard
            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
# ==== END WEEWX.CONF LOG CONFIGURATION =====


Tom Keffer

unread,
Mar 27, 2022, 7:28:52 AM3/27/22
to weewx-user
Just remove "StdPrint" from the list of reporting services to be run. So, this
report_services = weewx.engine.StdPrint, weewx.engine.StdReport
becomes this
report_services = weewx.engine.StdReport

--
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/edc0d432-8b15-4530-a96c-f0c784216e16n%40googlegroups.com.

Doug Jenkins

unread,
Mar 27, 2022, 8:01:38 AM3/27/22
to weewx-user
Thanks Tom I appreciate it! Worked as expected :)

vince

unread,
Nov 21, 2022, 8:09:48 PM11/21/22
to weewx-user
Sorry for the late reply.  Rebuilding/consolidating my docker setups and had a question...

Removing StdPrint 'does' work for suppressing the LOOP messages in Docker, but is there a way to get the same effect via a custom [Logging] stanza ?

I got very lost under the hood trying to follow how StdPrint is logging at all.
Would this be expected to work ?

[Logging]
    [[loggers]]
        [[[weewx.engine.StdPrint]]]
            level = ERROR

Tom Keffer

unread,
Nov 22, 2022, 8:07:41 AM11/22/22
to weewx...@googlegroups.com
StdPrint is sending messages directly to stdout via print() statements --- the logging facility is not involved at all. So, no, I would not expect that to work.

Doug is using a log handler that sends log messages to "console," that is, stdout. So, what you're looking at is a mixture of print() statements and logging messages.

Hope that helps.



--
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.

vince

unread,
Nov 22, 2022, 1:47:01 PM11/22/22
to weewx-user
Thanks for the explanation.  Doug+I are doing the same thing.  Suppressing LOOP via removing StdPrint and redirecting logging using the v4 logging to console as you documented for the wiki in the spring.  Difference is I'm building up from base debian as a starting point.

[...tl;dr...]

Doug's stuff has more dominos that have to be lined up to build the image. He builds on top of Tom Mitchell's image, which builds on top of an old pfusion base image, which has some uniquenesses in there for Docker if I remember from poking around a bit.   I think pfusion is released for less architectures too if I remember. I had to rebuild the whole stack starting with pfusion when I was trying 64-bit Ubuntu and 64-bit RaspiOS on a pi earlier this year and tried to build some Docker images on top of those os.  Took a while.

Results from a weewx perspective are the same once you get there of course, but I wanted a simpler path to updating the os under the hood and for playing around with switching the Docker host os version (RaspiOS/Ubuntu) and 32/64 bit variants of the host os.  Change one line in the Dockerfile and go for changing the weewx image os too.  Gotta love containers.

Doug Jenkins

unread,
Nov 22, 2022, 8:43:22 PM11/22/22
to weewx...@googlegroups.com
For my docker configuration for my weewx weatherstation, I add this configuration right after the version = x.x.x line. Give it a couple of empty lines to separate it out

###################################################
            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
        [[[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

##############################################################################




t...@tom.org

unread,
Nov 23, 2022, 7:21:07 AM11/23/22
to weewx-user
Re the Docker image, Vince is right that it did not support anything but what I was using, which is x86-64 (I run my instances as Kubetnetes pods). Now it supports arm, arm64, and x86-64.

Phusion is a weird base image, but it did a nice job of supporting the logging requirements of weewx. I would love a collaborator to either optimize this one or base it on another base altogether. I think Doug is working on something?

vince

unread,
Nov 23, 2022, 11:31:46 AM11/23/22
to weewx-user
On Wednesday, November 23, 2022 at 4:21:07 AM UTC-8 t...@tom.org wrote:
Phusion is a weird base image, but it did a nice job of supporting the logging requirements of weewx. I would love a collaborator to either optimize this one or base it on another base altogether. I think Doug is working on something?


I think both Doug and I have different similar variants similar to yours, big difference is the base image difference under the hood.   I'll update my debian-based repo on github when I get a chance this weekend and email you both with a pointer and maybe we can talk email...
 

Doug Jenkins

unread,
Nov 23, 2022, 3:22:29 PM11/23/22
to weewx...@googlegroups.com
Vince/Tom:

Actually I built my own image. It essentially builds weewx via python setup.py and I add a few popular extensions (mqtt, forecast, belchertown) as a "batteries include" release.

My docker image performs all of it's logging to stdout, so you can review the logs in your favorite orchestration tool (eg. I use portainer). My docker image also supports MySQL/MariaDB connections if needed.


 I will create a public repo with my weewx docker setup. I will post back here with a link and I will write a wiki article about it.

My biggest challenge is that my in laws are staying with us and I have kids camping out in my office, so access to my workstation is limited until this week is over. So please be patient until I get a chance to post it. :)

Doug Jenkins
Largoweather.com

vince

unread,
Nov 23, 2022, 4:31:45 PM11/23/22
to weewx-user
Mine is https://github.com/vinceskahan/weewx-docker if anybody has interest.  Not too bad at 205MB with Belchertown installed and enabled :-)

Hardest thing is lots of extensions/skins are either mis(un)configured out of the box or disabled.  The configobj format of weewx.conf makes it particularly difficult to tweak things inline in Dockerfile-like builds.

(hint - a small portable utility that could read weewx.conf and let folks do simple enable/disable/edits of a designated piece of that file would be a HUGE win toward automation, if anybody gets bored and feels the need to write such a tool....)

steepleian

unread,
Nov 24, 2022, 7:06:44 AM11/24/22
to weewx...@googlegroups.com
  Vince,
Watch this space. We are writing a weewx / skin admin page to go with the successor of weewx-Weather34. I am sure that this could be adapted to be portable for the greater good of the WeeWX universe.
Ian

Sent from my iPhone

On 23 Nov 2022, at 21:31, vince <vince...@gmail.com> wrote:

Mine is https://github.com/vinceskahan/weewx-docker if anybody has interest.  Not too bad at 205MB with Belchertown installed and enabled :-)
--
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.
Reply all
Reply to author
Forward
0 new messages