Skip to main content

build_syslog_frame

Function build_syslog_frame 

Source
fn build_syslog_frame(
    pri: u16,
    timestamp: &str,
    hostname: &str,
    app_name: &str,
    procid: u32,
    msg: &str,
) -> String
Expand description

Builds one RFC 5424 syslog frame. Pure and independent of the clock/network (the timestamp is passed in) so it can be unit-tested against a known value.

Shape: <PRI>1 TIMESTAMP HOSTNAME APP-NAME PROCID - MSG\n (MSGID and STRUCTURED-DATA are -, matching APISIX’s encoder).