Setting log level for syslog.syslog() style logging for older addons and modules

42 views
Skip to first unread message

kobuki

unread,
May 20, 2020, 5:44:24 PM5/20/20
to weewx-user
I've upgraded my 3.9.3 to 4.0.0 on a Debian 10. Unfortunately logging now is all over the place. Program name for rsyslog filters is either 'weewx' or 'weewxd' or on a second weewx instance, 'weewx-name'. That's the lesser of the issues, I can work around that. But then it ignores 'debug = 0' in weewx.conf when a module uses syslog.syslog() calls instead of the new Python logger. Modules put out debug messages in the log. The old "central" debug setting used to take care of them. Can I set the syslog logging level somehow in config for all modules that still use the facility?

gjr80

unread,
May 20, 2020, 8:24:00 PM5/20/20
to weewx-user
On Thursday, 21 May 2020 07:44:24 UTC+10, kobuki wrote:
I've upgraded my 3.9.3 to 4.0.0 on a Debian 10. Unfortunately logging now is all over the place.

Sounds a little harsh.

Program name for rsyslog filters is either 'weewx' or 'weewxd' or on a second weewx instance, 'weewx-name'.

I am running V4 under Debian 10 and see no 'weewxd' in the logs, but then again I only run setup.py installs and not package installs. 'weewx-name' for a second WeeWX instance is (and always has been) expected behaviour; if you are logging to a single file different program names for each WeeWX instance makes debugging far easier, also makes it far easier to log each instance to separate files.

But then it ignores 'debug = 0' in weewx.conf when a module uses syslog.syslog() calls instead of the new Python logger. Modules put out debug messages in the log. The old "central" debug setting used to take care of them. Can I set the syslog logging level somehow in config for all modules that still use the facility?

I doubt whether there will be any magic button you can press in a config file since V4 now uses the python logging module in lieu of the syslog module and consequently the old syslog setup code was removed in V4. There may well be some magic syslog incantation that someone will provide, but I suspect you will be best served by contacting the 3rd party extension authors and asking them to update their extension to work (properly) with V4.

Gary

kobuki

unread,
May 21, 2020, 4:47:10 AM5/21/20
to weewx-user
Thanks for your comment. No, it's not "harsh", logging IS all over the place, since it's in the designated weewx.log, syslog and also in the systemd journal under several different tags. I'm also aware of secondary instances' tagging scheme in the log. It's just that it's another source of misc. tagging, making it harder to organize and filter the log. Possibly it's caused by various modules using the old syslog module with assumptions about process names. I now constrained them using rsyslog filters, but it's more like inconsistent behavior or regression than anything else. What's not going to magically happen is all old module devs taking prior notice and fix all the old code to comply. At least the basic level of compatibility should have been kept, allowing the old debug flag work. There are also old modules that work very fine while being basically abandoned, but now have botched logging. And no, sadly not all of them are accessible nor willing to touch their legacy code.

gjr80

unread,
May 21, 2020, 4:56:03 AM5/21/20
to weewx-user
Yes, you maybe right. As Tom says, PRs are always welcome.

Gary

kobuki

unread,
May 21, 2020, 5:06:25 AM5/21/20
to weewx-user
Certainly, if I ever get to thoroughly know the insights of the logging mechanisms inside core WeeWx code, I will happily contribute a fix. However, until then, please don't sound like that's the only way to fix regressions. That aside, what I'd like to hear is some opinion or statement from core devs if they consider it a regression at all, or it was expected from the get go with all the breaking changes for 3rd party devs to catch up. I will respect their stance in that case and let it go.

Tom Keffer

unread,
May 21, 2020, 8:33:04 AM5/21/20
to weewx-user
For the record, Gary is one of the core developers.

For a variety of reasons, one of the goals of V4 was to not depend on syslog. Yes, you've found a regression, but not a very major one. It can't be fixed without breaking that goal.

We have tried hard to get 3rd parties to "catch up", to the point of submitting PRs for them. I personally have submitted a dozen or so.

...if I ever get to thoroughly know the insights of the logging mechanisms inside core WeeWx code, I will happily contribute a fix. However, until then, please don't sound like that's the only way to fix regressions. 

I'd also say, "No whining if you don't contribute."

-tk




--
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/9515f5d6-35c6-4806-b0a6-6f86a58b64c6%40googlegroups.com.

kobuki

unread,
May 21, 2020, 11:03:08 AM5/21/20
to weewx-user
That's fine. I can fix what's needed for me where upstream has ceased working on it. Until then I can suggest adding syslog filters on their system. I'm not sure there are still repos where I can commit, tho.

However, with all due respect, you don't maintain WeeWx for devs but for the general audience so the "whiney" comment is a bit out of the line, I think. Users will "whine" while not contributing a single line. And that's perfectly fine. Even if "whining" don't lead to anywhere. I can do all the fixes I need without barking around on these forums but I think if this has a viable user side solution for other folks with a similar problem, we can all benefit from seeing the solution here. I'm maintaining a driver now that also will get the v4 treatment. And that's also perfectly OK, since that's my job.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages