Struct slog_syslog5424::Rfc5424Builder [−][src]
pub struct Rfc5424Builder { /* fields omitted */ }
Builder for Rfc5424
Methods
impl Rfc5424Builder
[src]
impl Rfc5424Builder
pub fn new(enterprise_id: &str, facility: Facility) -> Rfc5424Builder
[src]
pub fn new(enterprise_id: &str, facility: Facility) -> Rfc5424Builder
pub fn build(self) -> Rfc5424
[src]
pub fn build(self) -> Rfc5424
Transform the builder into a formatter struct.
pub fn hostname(self, val: &str) -> Result<Rfc5424Builder, Error>
[src]
pub fn hostname(self, val: &str) -> Result<Rfc5424Builder, Error>
Set the hostname used in the header of the syslog message.
Errors
val
's length is larger than 255val
is an empty stringval
doesn't contain printable ASCII characters (seechar::is_ascii_graphic
)
pub fn app_name(self, val: &str) -> Result<Rfc5424Builder, Error>
[src]
pub fn app_name(self, val: &str) -> Result<Rfc5424Builder, Error>
Set the app name used in the header of the syslog message.
Errors
val
's length is larger than 48val
is an empty stringval
doesn't contain printable ASCII characters (seechar::is_ascii_graphic
)
pub fn pid(self, val: &str) -> Result<Rfc5424Builder, Error>
[src]
pub fn pid(self, val: &str) -> Result<Rfc5424Builder, Error>
Set the process id (PID) used in the header of the syslog message.
Errors
val
's length is larger than 128val
is an empty stringval
doesn't contain printable ASCII characters (seechar::is_ascii_graphic
)
pub fn msg_id(self, val: &str) -> Result<Rfc5424Builder, Error>
[src]
pub fn msg_id(self, val: &str) -> Result<Rfc5424Builder, Error>
Set the msgId used in the header of the syslog message. (OPTIONAL)
The MSGID SHOULD identify the type of message. For example, a firewall might use the MSGID "TCPIN" for incoming TCP traffic and the MSGID "TCPOUT" for outgoing TCP traffic. Messages with the same MSGID should reflect events of the same semantics. The MSGID itself is a string without further semantics. It is intended for filtering messages on a relay or collector.
Errors
val
's length is larger than 32val
is an empty stringval
doesn't contain printable ASCII characters (seechar::is_ascii_graphic
)
pub fn write_format(self, f: WriteFormat) -> Rfc5424Builder
[src]
pub fn write_format(self, f: WriteFormat) -> Rfc5424Builder
Set the format of the output between RFC5424 and RFC5425.
RFC5425 is the same as RFC5424 except it prepends the length of the message.
Example
RFC5424: <11>1 - server1.example.com my_app_name 5445 msg_id [hello@ent_id id="54" progress="complete"] sample message
RFC5425: 130 <11>1 - server1.example.com my_app_name 5445 msg_id [hello@ent_id id="54" progress="complete"] sample message
pub fn origin(self, o: Origin) -> Rfc5424Builder
[src]
pub fn origin(self, o: Origin) -> Rfc5424Builder
Add an IANA reserved origin key-value pair.
Examples
let f = Rfc5424Builder::new("enterprise_id", Facility::User) .origin(Origin::Ip("127.0.0.1")) .origin(Origin::Version("12.2.1")) .build();
pub fn time_quality(self, t: TimeQuality) -> Rfc5424Builder
[src]
pub fn time_quality(self, t: TimeQuality) -> Rfc5424Builder
Add an IANA reserved time quality key-value pair.
Examples
let f = Rfc5424Builder::new("enterprise_id", Facility::User) .time_quality(TimeQuality::TzKnown(true)) .time_quality(TimeQuality::IsSynced(true)) .time_quality(TimeQuality::SyncAccuracy(1000)) .build();
Auto Trait Implementations
impl Send for Rfc5424Builder
impl Send for Rfc5424Builder
impl Sync for Rfc5424Builder
impl Sync for Rfc5424Builder