pub struct SyslogBuilder { /* private fields */ }Expand description
A builder to configure and create an Syslog appender.
Implementations§
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyslogBuilder
impl !RefUnwindSafe for SyslogBuilder
impl Send for SyslogBuilder
impl Sync for SyslogBuilder
impl Unpin for SyslogBuilder
impl !UnwindSafe for SyslogBuilder
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