pub struct SyslogBuilder { /* private fields */ }
Expand description
A builder to configure and create an Syslog
appender.
Implementations§
Source§impl SyslogBuilder
impl SyslogBuilder
Sourcepub fn unix_stream(path: impl AsRef<Path>) -> Result<SyslogBuilder>
Available on Unix only.
pub fn unix_stream(path: impl AsRef<Path>) -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the given Unix stream socket.
Sourcepub fn unix_datagram(path: impl AsRef<Path>) -> Result<SyslogBuilder>
Available on Unix only.
pub fn unix_datagram(path: impl AsRef<Path>) -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the given Unix datagram socket.
Source§impl SyslogBuilder
impl SyslogBuilder
Sourcepub fn new(sender: SyslogSender) -> Self
pub fn new(sender: SyslogSender) -> Self
Create a new builder.
Sourcepub fn format(self, format: SyslogFormat) -> Self
pub fn format(self, format: SyslogFormat) -> Self
Set the format of the Syslog
appender.
Sourcepub fn context(self, context: SyslogContext) -> Self
pub fn context(self, context: SyslogContext) -> Self
Set the context of the Syslog
appender.
Sourcepub fn layout(self, layout: impl Into<Box<dyn Layout>>) -> Self
pub fn layout(self, layout: impl Into<Box<dyn Layout>>) -> Self
Set the layout of the Syslog
appender.
Default to None
, the message will construct with only Record::payload
.
Sourcepub fn tcp_well_known() -> Result<SyslogBuilder>
pub fn tcp_well_known() -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the well-known TCP port (514).
Sourcepub fn tcp<A: ToSocketAddrs>(addr: A) -> Result<SyslogBuilder>
pub fn tcp<A: ToSocketAddrs>(addr: A) -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the given TCP address.
Sourcepub fn udp_well_known() -> Result<SyslogBuilder>
pub fn udp_well_known() -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the well-known UDP port (514).
Sourcepub fn udp<L: ToSocketAddrs, R: ToSocketAddrs>(
local: L,
remote: R,
) -> Result<SyslogBuilder>
pub fn udp<L: ToSocketAddrs, R: ToSocketAddrs>( local: L, remote: R, ) -> Result<SyslogBuilder>
Create a new syslog writer that sends messages to the given UDP address.
Sourcepub fn broadcast_well_known() -> Result<SyslogBuilder>
pub fn broadcast_well_known() -> Result<SyslogBuilder>
Create a new syslog writer that broadcast messages to the well-known UDP port (514).
Sourcepub fn broadcast(port: u16) -> Result<SyslogBuilder>
pub fn broadcast(port: u16) -> Result<SyslogBuilder>
Create a new syslog writer that broadcast messages to the given UDP address.