mr-canoehead / network_performance_monitor

Network Performance Monitor - a portable tool for troubleshooting performance issues with home networks
GNU General Public License v3.0
84 stars 21 forks source link

journalctl doesn't have logs from netperf-interfaces #22

Closed idank closed 3 years ago

idank commented 4 years ago

It appears the netperf-interfaces service doesn't emit its stdout to journalctl:

journalctl -u netperf-interfaces.service
-- Logs begin at Sun 2020-09-27 10:49:48 IDT, end at Sun 2020-09-27 15:17:01 IDT. --
Sep 27 10:50:02 netmon systemd[1]: Starting Network Performance Monitor Interface Configuration...
Sep 27 10:50:03 netmon python3[614]: RTNETLINK answers: File exists
Sep 27 10:50:03 netmon systemd[1]: netperf-interfaces.service: Succeeded.
Sep 27 10:50:03 netmon systemd[1]: Started Network Performance Monitor Interface Configuration.

When I manually run sudo /usr/bin/python3 /opt/netperf/configure_interfaces.py, I get the full output.

I tried looking around the docs a bit but couldn't figure out why it's not including the print calls from configure_interfaces.py.

idank commented 4 years ago

Also it looks like the script configures a configure_log Logger but doesn't use it. Is that intentional?

mr-canoehead commented 4 years ago

Logging is an aspect of the system that definitely needs improvement.

I introduced centralized logging for the netperf related processes so that all messages will be written to the netperf log file (e.g. /usb_storage/netperf/log/netperf.log), this will reduce the amount of writes performed on the SD card. It's also useful to have all netperf related log messages in one place, separate from other system log messages.

I have not yet completely updated all the processes to thoroughly utilize this centralized logging.

Would you be interested in tackling this?

Chris

idank commented 4 years ago

Sure, leave me some high level instructions and I'll give it a go.

idank commented 4 years ago

Also just for my curiosity, do you know why the stdout of the process isn't visible to journalctl?

mr-canoehead commented 3 years ago

I have updated the configure-interfaces.py script to improve logging, messages are now written to netperf.log (location of this file varies depending on the application data path specified during system installation - typically /mnt/usb_storage/netperf/log/netperf.log on Raspberry Pi installations). The level of detail included in the log messages can be controlled via the log_level setting in /opt/netperf/config/netperf.json. For a high level of detail during interface configuration, set log_level to DEBUG.