Geal / rust-syslog

Send syslog messages from Rust
MIT License
110 stars 55 forks source link

Formatter5424 is not compliant with the RFC #60

Closed dgouarin closed 2 years ago

dgouarin commented 2 years ago

When using Formatter5424, a redundant space is added between PRI and VERSION fields.

<134> 1 2021-12-08T10:54:02Z localhost [...] instead of <134>1 2021-12-08T10:54:02Z localhost [...] This makes this formatter unusable with rsyslog's default parser for example. Attached patch ``` --- /nfs/thirdparty/rust-vendor/syslog/src/format.rs 2021-12-08 13:58:10.606694317 +0100 +++ syslog/src/format.rs 2021-12-08 12:00:44.361712761 +0100 @@ -114,7 +114,7 @@ fn format(&self, w: &mut W, severity: Severity, log_message: (i32, StructuredData, T)) -> Result<()> { let (message_id, data, message) = log_message; - write!(w, "<{}> {} {} {} {} {} {} {} {}", + write!(w, "<{}>{} {} {} {} {} {} {} {}", encode_priority(severity, self.facility), 1, // version time::now_utc().rfc3339(), ```
dgouarin commented 2 years ago

oops already fixed, sorry