From bf1dd995c0b33105370f891b0e29b4205acdb6c7 Mon Sep 17 00:00:00 2001 From: Hugo Tunius Date: Wed, 20 Nov 2024 11:40:29 +0000 Subject: [PATCH] Tweak syslog format --- src/backend/mod.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/backend/mod.rs b/src/backend/mod.rs index fc131fc..af68a65 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -241,13 +241,8 @@ mod system { use std::io::Write; let pri = (*record.facility as u8) * 8 + (record.severity as u8); - // 2019-03-18T13:12:27.000+00:00 - let time = record.timestamp.format("%Y-%m-%dT%H:%M:%S%.3f%:z"); - let hostname = chk(record.hostname.as_str()); let app_name = chk(record.app_name.as_str()); - let msg_id = chk(&record.msg_id); let pid = record.pid; - let env = record.env.as_str(); let msg = StripCtrl(record.message.as_ref().map(|s| s.as_str()).unwrap_or("")); let mut socket_and_buf = self.socket_and_buf.lock().unwrap(); let (socket, buf) = socket_and_buf.deref_mut(); @@ -256,10 +251,7 @@ mod system { // Clear out the buffer buf.clear(); - write!( - buf, - r#"<{pri}>1 {time} {hostname} {app_name} {pid} {msg_id} [env="{env}"] {msg}"# - ); + write!(buf, r#"<{pri}>{app_name}[{pid}] {msg}"#); if let Some(w) = &record.well_known { write!(buf, " ");