These two log.info lines in manager.py do not use the config file log_success switch, resulting in entries every five minutes. Adding the log_success switch test within _addSingleRecord instances is not trivial since the config is not passed to the object.
May 12 18:55:15 shop2 journal: weewx[7760] INFO weewx.manager: Added record 2020-05-12 18:55:00 MST (1589334900) to database 'weewx.sdb'
May 12 18:55:15 shop2 journal: weewx[7760] INFO weewx.manager: Added record 2020-05-12 18:55:00 MST (1589334900) to daily summary in 'weewx.sdb'
This was noted back in 2017 also by Daniel Jönsson in this thread - not a new issue. I just commented out the two calls to log.info(). I'm just working to clean up noise in my system log.
--
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/11778f1a-f56b-4753-97e9-4bc53c9a03e3%40googlegroups.com.
First, read, or, at least, attempt to read, the section on the schema of the configuration dictionary thatlogginguses.
# If you plan on using wunderfixer, set the following
# to your API key:
api_key = replace_me
Version 4.0 allows much more control over what gets logged. To suppress everything below log level WARN, put this at the bottom of weewx.conf:[Logging]
[[loggers]]
[[[weewx.manager]]]
level = WARN-tk
On Thu, May 14, 2020 at 9:53 PM Chris Nelson <cjnc...@gmail.com> wrote:
--These two log.info lines in manager.py do not use the config file log_success switch, resulting in entries every five minutes. Adding the log_success switch test within _addSingleRecord instances is not trivial since the config is not passed to the object.
May 12 18:55:15 shop2 journal: weewx[7760] INFO weewx.manager: Added record 2020-05-12 18:55:00 MST (1589334900) to database 'weewx.sdb'
May 12 18:55:15 shop2 journal: weewx[7760] INFO weewx.manager: Added record 2020-05-12 18:55:00 MST (1589334900) to daily summary in 'weewx.sdb'
This was noted back in 2017 also by Daniel Jönsson in this thread - not a new issue. I just commented out the two calls to log.info(). I'm just working to clean up noise in my system log.
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...@googlegroups.com.
I tried to follow the instructions in the v4 logging wiki, https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging. I added this to my weewx.conf file:
[Logging]
[[loggers]]
# Root logger
[[[root]]]
handlers = rotate, # 1
[[handlers]]
# Log to a set of rotating files
[[[rotate]]]
level = DEBUG # 2
formatter = standard # 3
class = logging.handlers.RotatingFileHandler # 4
filename = /var/log/weewx.log # 5
maxBytes = 10000000 # 6
backupCount = 4 # 7
Nothing is being logged to the weewx.log file and weewx is not updating the archive file or reports. It appears weewx has crashed but syslog is not showing anything which I’m assuming indicates the program is trying to write to the weewx.log file but cannot hence it isn’t recording any error messages.
I tried top add syslog to the handlers thinking something might show up in syslog.
handlers = rotate, syslog
This is what I get in the syslog file:
May 15 14:20:21 raspberrypi systemd[1]: Starting LSB: weewx weather system...
May 15 14:20:21 raspberrypi weewx[2183] INFO __main__: Initializing weewx version 4.0.0
May 15 14:20:21 raspberrypi weewx[2183] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
May 15 14:20:21 raspberrypi weewx[2183] INFO __main__: Platform Linux-4.19.97-v7+-armv7l-with-debian-10.4
May 15 14:20:21 raspberrypi weewx[2183] INFO __main__: Locale is 'en_US.UTF-8'
May 15 14:20:21 raspberrypi weewx[2183] INFO __main__: PID file is /var/run/weewx.pid
This is a new install. Everything works fine until I try to add [Logging} to the weewx.conf file.
Tom
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEDmQAMGzTFNDmhsXBupmo9e65%2B2CPEDDGiEuinW%2BYXXfg%40mail.gmail.com.
Thinking out loud here... Running as the Pi user? Have write access to /var/log?
--
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/8fb4e590-c1f8-4220-beef-ab6e6baba964%40googlegroups.com.
Thanks Tom. I updated the logger.py file and all is well. I also changed the formatter to verbose so I could get date/time stamps.
Tom
From: weewx...@googlegroups.com <weewx...@googlegroups.com> On Behalf Of Tom Keffer
Sent: Friday, May 15, 2020 7:09 PM
To: weewx-user <weewx...@googlegroups.com>
Subject: Re: [weewx-user] Noisy logging, log_success = False not followed
Sorry, Tom. This is due to a bug in how weewx configures the logger. The problem is that weewx does not convert strings to int when configuring. It was fixed a couple weeks ago (commit 6348741), but I totally forgot about it.
You have two choices:
1. Replace your copy of weeutil/logger.py with the one in the repository, or
2. remove the integers from the configuration stanza. It becomes
[Logging]
[[loggers]]
# Root logger
[[[root]]]
handlers = rotate, # 1
[[handlers]]
# Log to a set of rotating files
[[[rotate]]]
level = DEBUG # 2
formatter = standard # 3
class = logging.handlers.RotatingFileHandler # 4
filename = /var/log/weewx.log # 5
-tk
On Fri, May 15, 2020 at 3:58 PM Chris Nelson <cjnc...@gmail.com> wrote:
Thinking out loud here... Running as the Pi user? Have write access to /var/log?
--
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/8fb4e590-c1f8-4220-beef-ab6e6baba964%40googlegroups.com.
--
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/CAPq0zEAkF8DDP%3D5ahXooNr2KiSFzQbcLWKo2tU4Y4RQMb7f8yw%40mail.gmail.com.
Following these instructions I had logging to weewx.log working. I upgraded to 4.1.0 and am now logging to syslog and not weewx.log. I tied Logging with and without the integers in my config file as below.
#[Logging]
# [[loggers]]
# # Root logger
# [[[root]]]
# handlers = rotate,
# [[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
[Logging]
[[loggers]]
# Root logger
[[[root]]]
handlers = rotate,
[[handlers]]
# Log to a set of rotating files
[[[rotate]]]
level = DEBUG
formatter = verbose
class = logging.handlers.RotatingFileHandler
filename = /var/log/weewx.log
Tom
From: weewx...@googlegroups.com <weewx...@googlegroups.com> On Behalf Of Tom Keffer
Sent: Friday, May 15, 2020 7:09 PM
To: weewx-user <weewx...@googlegroups.com>
Subject: Re: [weewx-user] Noisy logging, log_success = False not followed
Sorry, Tom. This is due to a bug in how weewx configures the logger. The problem is that weewx does not convert strings to int when configuring. It was fixed a couple weeks ago (commit 6348741), but I totally forgot about it.
You have two choices:
1. Replace your copy of weeutil/logger.py with the one in the repository, or
2. remove the integers from the configuration stanza. It becomes
[Logging]
[[loggers]]
# Root logger
[[[root]]]
handlers = rotate, # 1
[[handlers]]
# Log to a set of rotating files
[[[rotate]]]
level = DEBUG # 2
formatter = standard # 3
class = logging.handlers.RotatingFileHandler # 4
filename = /var/log/weewx.log # 5
-tk
On Fri, May 15, 2020 at 3:58 PM Chris Nelson <cjnc...@gmail.com> wrote:
Thinking out loud here... Running as the Pi user? Have write access to /var/log?
--
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/8fb4e590-c1f8-4220-beef-ab6e6baba964%40googlegroups.com.
--
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/CAPq0zEAkF8DDP%3D5ahXooNr2KiSFzQbcLWKo2tU4Y4RQMb7f8yw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/08c501d632e7%24a27a3340%24e76e99c0%24%40gmail.com.
Thanks Tom. Working fine now.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zECPvYKTQJ%3D7On3wWHjOTF1ytc9_n6_6tiBSrKdfh8T8NA%40mail.gmail.com.