pub struct Syslog { /* private fields */ }Expand description
Encodes LogEvents in RFC 5424 syslog format.
The hostname and app-name fields in the syslog header are configurable at construction
time. They default to "sonda" and "sonda" respectively.
Only encode_log is supported. encode_metric returns an error because syslog is a
log-only format.
Implementations§
Trait Implementations§
Source§impl Encoder for Syslog
impl Encoder for Syslog
Source§fn encode_metric(
&self,
_event: &MetricEvent,
_buf: &mut Vec<u8>,
) -> Result<(), SondaError>
fn encode_metric( &self, _event: &MetricEvent, _buf: &mut Vec<u8>, ) -> Result<(), SondaError>
Syslog encodes only log events. Returns an error for metric events.
Source§fn encode_log(
&self,
event: &LogEvent,
buf: &mut Vec<u8>,
) -> Result<(), SondaError>
fn encode_log( &self, event: &LogEvent, buf: &mut Vec<u8>, ) -> Result<(), SondaError>
Encode a log event as an RFC 5424 syslog line appended to buf.
Format (no labels): <priority>1 timestamp hostname app-name - - - message\n
Format (with labels): <priority>1 timestamp hostname app-name - - [sonda k="v" ...] message\n
Priority = (facility * 8) + syslog_severity. Facility 1 (user-level) is used.
Auto Trait Implementations§
impl Freeze for Syslog
impl RefUnwindSafe for Syslog
impl Send for Syslog
impl Sync for Syslog
impl Unpin for Syslog
impl UnsafeUnpin for Syslog
impl UnwindSafe for Syslog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more