Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFO still logged, despite verbose: false and diagnostics: false #1135

Open
wolfgangr opened this issue Oct 13, 2024 · 4 comments
Open

INFO still logged, despite verbose: false and diagnostics: false #1135

wolfgangr opened this issue Oct 13, 2024 · 4 comments

Comments

@wolfgangr
Copy link

Describe the bug

I still have syslog entries every 16 seconds
.... | INFO | Published to my/weather/topic ....

To Reproduce
Steps to reproduce the behavior:

  • install ecowitt2mqtt on a debian bookworm
  • configure it as systemd service
  • enjoy it running stable for weeks now
  • change to diagnostics: false verbose: false in ecowitt2mqtt.conf
  • :~/ecowitt2mqtt$ sudo systemctl status ecowitt2mqtt.service

Expected behavior
only high level info / warning / error logged
quiet in normal operation

Screenshots

Oct 13 15:12:09 homeserver ecowitt2mqtt[3629071]: 2024-10-13 15:12:09,429 | INFO | Published to wetter/pleussen/station
Oct 13 15:12:25 homeserver ecowitt2mqtt[3629071]: 2024-10-13 15:12:25,445 | INFO | Published to wetter/pleussen/station
Oct 13 15:12:34 homeserver systemd[1]: Stopping ecowitt2mqtt.service - ECOWITT2MQTT daemon...
Oct 13 15:12:34 homeserver systemd[1]: ecowitt2mqtt.service: Deactivated successfully.
Oct 13 15:12:34 homeserver systemd[1]: Stopped ecowitt2mqtt.service - ECOWITT2MQTT daemon.
Oct 13 15:12:34 homeserver systemd[1]: ecowitt2mqtt.service: Consumed 1.743s CPU time.
Oct 13 15:12:34 homeserver systemd[1]: Started ecowitt2mqtt.service - ECOWITT2MQTT daemon.
Oct 13 15:12:36 homeserver ecowitt2mqtt[3629111]: 2024-10-13 15:12:36,387 | INFO | Starting ecowitt2mqtt (version 2024.06.2)
Oct 13 15:12:41 homeserver ecowitt2mqtt[3629111]: 2024-10-13 15:12:41,440 | INFO | Published to wetter/pleussen/station
Oct 13 15:12:58 homeserver ecowitt2mqtt[3629111]: 2024-10-13 15:12:58,401 | INFO | Published to wetter/pleussen/station
Oct 13 15:13:13 homeserver ecowitt2mqtt[3629111]: 2024-10-13 15:13:13,447 | INFO | Published to wetter/pleussen/station

Additional context

I don't see anything in the system file that might override .conf

:~/ecowitt2mqtt$ cat /etc/systemd/system/ecowitt2mqtt.service 
# https://github.com/bachya/ecowitt2mqtt/tree/dev?tab=readme-ov-file#running-in-the-background
[Unit]
Description=ECOWITT2MQTT daemon
After=network.target

[Service]
Type=simple
# ExecStart=ecowitt2mqtt --mqtt-broker=192.168.1.101 --mqtt-username=user --mqtt-password=password
ExecStart=/home/wrosner/.local/bin/ecowitt2mqtt --config /home/wrosner/ecowitt2mqtt/ecowitt2mqtt.conf
ExecReload=kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=5s
# User=wrosner
User=daemon

[Install]
WantedBy=multi-user.target
@wolfgangr
Copy link
Author

cleaning out all comments from the .conf does not help

wrosner@homeserver:~/ecowitt2mqtt$ cat ecowitt2mqtt.conf
---
mqtt_topic: wetter/pleussen/station
mqtt_broker: homeserver.rosner.lokal
mqtt_username: ecowitt
mqtt_password: geetabo5uucheeKiipip
locale: de_DE.UTF-8
endpoint: /data/report
diagnostics: false
input_data_format: ecowitt
input_unit_system: imperial
output_unit_system: metric
output_unit_temperature: °C
verbose: false

@wolfgangr
Copy link
Author

it's running in a python pipx venv, obviously:

wrosner@homeserver:~/ecowitt2mqtt$ sudo systemctl status ecowitt2mqtt.service 
● ecowitt2mqtt.service - ECOWITT2MQTT daemon
     Loaded: loaded (/etc/systemd/system/ecowitt2mqtt.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-10-13 15:38:11 CEST; 1min 17s ago
   Main PID: 3629493 (ecowitt2mqtt)
      Tasks: 7 (limit: 9329)
     Memory: 46.7M
        CPU: 1.468s
     CGroup: /system.slice/ecowitt2mqtt.service
             └─3629493 /home/wrosner/.local/pipx/venvs/ecowitt2mqtt/bin/python /home/wrosner/.local/bin/ecowitt2mqtt --config /home/wrosner/ecowitt2mqtt/ecowitt2mqtt.conf

Oct 13 15:38:11 homeserver systemd[1]: Started ecowitt2mqtt.service - ECOWITT2MQTT daemon.
Oct 13 15:38:12 homeserver ecowitt2mqtt[3629493]: 2024-10-13 15:38:12,648 | INFO | Starting ecowitt2mqtt (version 2024.06.2)
Oct 13 15:38:16 homeserver ecowitt2mqtt[3629493]: 2024-10-13 15:38:16,870 | INFO | Published to wetter/pleussen/station

@wolfgangr
Copy link
Author

wolfgangr commented Oct 13, 2024

Ah, I remember, It's not only open, but even comprehensible source.
So I grepped the cause and changed it:

wrosner@homeserver:~/.local/pipx/venvs/ecowitt2mqtt/lib/python3.11/site-packages/ecowitt2mqtt/helpers/publisher/mqtt$ diff  __init__.py.000 __init__.py 
82c82,83
<         LOGGER.info("Published to %s", self._config.mqtt_topic)
---
>         # LOGGER.info("Published to %s", self._config.mqtt_topic)
>         LOGGER.debug("Published to %s", self._config.mqtt_topic)

New state: works for me 👍
@bachya , I'll keep it open for you to decide whether you want to change this, too.

@bachya
Copy link
Owner

bachya commented Oct 13, 2024

INFO logs are logged all the time; verbose controls only DEBUG logs. That's as designed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants