RFC5424 The Syslog Protocol

This commit is contained in:
Andrei
2024-01-10 17:39:13 +02:00
parent 5e41111da8
commit 2bc175093f
+2 -2
View File
@@ -12,7 +12,7 @@ WiFiUDP udpClient;
namespace SYSLOG_Utils {
void log(String type, String packet, int rssi, float snr, int freqError) {
String syslogPacket = Config.callsign + " LoRa / ";
String syslogPacket = "<165>1 - " + Config.callsign + " LoRa" + " - - - "; //RFC5424 The Syslog Protocol
if (Config.syslog.active && (stationMode==1 || stationMode==2 || (stationMode==5 && WiFi.status()==WL_CONNECTED))) {
if (type == "APRSIS Tx") {
if (packet.indexOf(":>") > 10) {
@@ -55,7 +55,7 @@ namespace SYSLOG_Utils {
syslogPacket += type + " / " + packet;
}
} else {
syslogPacket = "ERROR / Error in Syslog Packet";
syslogPacket = "<165>1 - ERROR LoRa - - - ERROR / Error in Syslog Packet"; //RFC5424 The Syslog Protocol
}
udpClient.beginPacket(Config.syslog.server.c_str(), Config.syslog.port);
udpClient.write((const uint8_t*)syslogPacket.c_str(), syslogPacket.length());