How to reduce husarnet-daemon logs?

Hi,

How to reduce the logs created by the daemon?

Daemon is logging thousands of lines and I would like to only have error or warning level logs from it.

Aug 10 00:47:39 AP-004 husarnet-daemon[908]: 2024-08-10_00:47:39 INFO     hello 2 from a*****b
Aug 10 00:47:39 AP-004 husarnet-daemon[908]: 2024-08-10_00:47:39 INFO     established secure connection to *****
Aug 10 00:47:39 AP-004 husarnet-daemon[908]: 2024-08-10_00:47:39 INFO     reestablish connection to [*****]
Aug 10 00:47:39 AP-004 husarnet-daemon[908]: 2024-08-10_00:47:39 INFO     hello 3 from *****
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     reestablish connection to [*****]
Aug 10 00:48:04 AP-004 husarnet-daemon[908]: 2024-08-10_00:48:04 INFO     send multicast to 6 destinations

Thank you!

Hi @bnbhat :wave:

You can do this using HUSARNET_LOG_VERBOSITY variable.

Here is what each value for this variable means:

    NONE, /* 0 */
    CRITICAL /* 1 */,
    ERROR /* 2 */,
    WARNING /* 3 */,
    INFO /* 4 */,
    DEBUG /* 5 */);

To apply this setting for Husarnet on every system boot open your /etc/systemd/system/husarnet.service file, and under

[Service]
Type=notify

add following line:

Environment="HUSARNET_LOG_VERBOSITY=3"
In my case end result looks like this:
[Unit]
Description=Husarnet
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
Environment="HUSARNET_LOG_VERBOSITY=3"
ExecStart=/usr/bin/husarnet-daemon
Restart=always
RestartSec=3
NotifyAccess=all

[Install]
WantedBy=multi-user.target

I hope this information was helpful. Please let me know if you have any questions.

Regards, Filip

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.