Merge pull request #21 from yo8ssq/main

RFC5424 The Syslog Protocol - standardizing I-gate log output
This commit is contained in:
Ricardo Guzman (Richonguzman) 2024-01-11 19:09:23 -03:00 committed by GitHub
commit 2312eada2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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());