Struct flexi_logger::writers::Syslog
source · pub struct Syslog(/* private fields */);
syslog_writer
only.Expand description
Implements the connection to the syslog.
Choose one of the factory methods that matches your environment,
depending on how the syslog is managed on your system,
how you can access it and with which protocol you can write to it.
Is required to instantiate a SyslogWriter
.
Implementations§
source§impl Syslog
impl Syslog
sourcepub fn try_datagram<P: AsRef<Path>>(path: P) -> IoResult<Self>
Available on target_family="unix"
only.
pub fn try_datagram<P: AsRef<Path>>(path: P) -> IoResult<Self>
target_family="unix"
only.Returns a Syslog implementation that connects via unix datagram to the specified path.
§Errors
Any kind of I/O error can occur.
sourcepub fn try_stream<P: AsRef<Path>>(path: P) -> IoResult<Self>
Available on target_family="unix"
only.
pub fn try_stream<P: AsRef<Path>>(path: P) -> IoResult<Self>
target_family="unix"
only.Returns a Syslog implementation that connects via unix stream to the specified path.
§Errors
Any kind of I/O error can occur.
sourcepub fn try_tcp<T: ToSocketAddrs>(server: T) -> IoResult<Self>
pub fn try_tcp<T: ToSocketAddrs>(server: T) -> IoResult<Self>
Returns a Syslog implementation that sends the log lines via TCP to the specified address.
§Errors
std::io::Error
if opening the stream fails.
sourcepub fn try_udp<T: ToSocketAddrs>(local: T, server: T) -> IoResult<Self>
pub fn try_udp<T: ToSocketAddrs>(local: T, server: T) -> IoResult<Self>
Returns a Syslog implementation that sends the log via the fragile UDP protocol from local to server.
§Errors
std::io::Error
if opening the stream fails.