Excessive logging?

Firmware 0.3.3
Software 0.3.0

Recently started using the Power HAT for a project, and I’ve noticed that the software agents are very noisy over syslog. I get roughly 5 messages a second in /var/log/syslog. I’ve tried finding the python log lines and I’ve tried changing the systemctl StandardOut and StandardError entries. I’ve not been able to get the logging to quiet down.

Any thoughts on how I can handle this?

Here’s an example of the logs:

Nov 15 22:18:49 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:49] "#033[37mGET /metrics/battery/voltage HTTP/1.1#033[0m" 200 -
Nov 15 22:18:49 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:49] "#033[37mGET /metrics/battery/current HTTP/1.1#033[0m" 200 -
Nov 15 22:18:49 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:49] "#033[37mGET /metrics/battery/power HTTP/1.1#033[0m" 200 -
Nov 15 22:18:56 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:56] "#033[37mGET /signals/soft_shutdown HTTP/1.1#033[0m" 200 -
Nov 15 22:18:56 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:56] "#033[37mGET /signals/soft_reboot HTTP/1.1#033[0m" 200 -
Nov 15 22:18:56 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:56] "#033[37mGET /signals/system_temperature HTTP/1.1#033[0m" 200 -
Nov 15 22:18:59 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:18:59] "#033[37mGET /metrics/version HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/fan/health HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /signals/watchdog_alarm HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/working_mode HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/battery/level HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/battery/health HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/fan/speed HTTP/1.1#033[0m" 200 -
Nov 15 22:19:00 HOSTNAME python3[306]: 127.0.0.1 - - [15/Nov/2020 22:19:00] "#033[37mGET /metrics/input/temperature HTTP/1.1#033[0m" 200 -

Hi @grover.sheldon,

There are 2 ways to do this:

  1. Recommended
    Modify /opt/sixfab/pms/api/run_server.py by adding the following block of code before the conditional statement.

    import logging
    log = logging.getLogger('werkzeug')
    log.setLevel(logging.ERROR)
    

    Then restart the service to enable the changes.
    sudo systemctl restart power_request.service

  2. Add the following to the [Service] section of your service file(/etc/systemd/system/power_request.service).

    StandardOutput=null

    Then reload systemd.

    sudo systemctl daemon-reload
    sudo systemctl restart power_request.service