Feature: Add syslog logger

This implements RFC5424 version of the protocol.

Doesn't use https://github.com/arcao/Syslog since the protocol itself
is trivial and most of the libraries functionality is not needed here.
The library also doesn't support setting the PROCID field, which is set
to a random id to indicate a reboot here.

Adds UI for syslog configuration to network admin view.
This commit is contained in:
ranma
2024-09-26 23:01:06 +02:00
committed by Thomas Basler
parent 3d39349876
commit bf31ccd02c
5 changed files with 180 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
*/
#include "NetworkSettings.h"
#include "Configuration.h"
#include "SyslogLogger.h"
#include "PinMapping.h"
#include "Utils.h"
#include "__compiled_constants.h"
@@ -57,6 +58,8 @@ void NetworkSettingsClass::init(Scheduler& scheduler)
scheduler.addTask(_loopTask);
_loopTask.enable();
Syslog.init(scheduler);
}
void NetworkSettingsClass::NetworkEvent(const WiFiEvent_t event, WiFiEventInfo_t info)
@@ -335,6 +338,8 @@ void NetworkSettingsClass::applyConfig()
ESP_LOG_LEVEL_LOCAL((success ? ESP_LOG_INFO : ESP_LOG_ERROR), TAG, "Configuring WiFi %s", success ? "done" : "failed");
setStaticIp();
Syslog.updateSettings(getHostname());
}
void NetworkSettingsClass::setHostname()