[−][src]Enum flexi_logger::writers::SyslogConnector
Helper struct that connects to the syslog and implements Write.
Is used in SyslogWriter::try_new
.
Example
use flexi_logger::writers::SyslogConnector; let syslog_connector = SyslogConnector::try_tcp("localhost:7777").unwrap();
Variants
Stream(BufWriter<UnixStream>)
Sends log lines to the syslog via a UnixStream.
Is only available on linux.
Datagram(UnixDatagram)
Sends log lines to the syslog via a UnixDatagram.
Is only available on linux.
Udp(UdpSocket)
Sends log lines to the syslog via UDP.
UDP is fragile and thus discouraged except for local communication.
Sends log lines to the syslog via TCP.
Methods
impl SyslogConnector
[src]
pub fn try_datagram<P: AsRef<Path>>(path: P) -> IoResult<SyslogConnector>
[src]
Returns a SyslogConnector::Datagram
to the specified path.
Is only available on linux.
pub fn try_stream<P: AsRef<Path>>(path: P) -> IoResult<SyslogConnector>
[src]
Returns a SyslogConnector::Stream
to the specified path.
Is only available on linux.
pub fn try_tcp<T: ToSocketAddrs>(server: T) -> IoResult<Self>
[src]
Returns a SyslogConnector
which sends the log lines via TCP to the specified address.
Errors
std::io::Error
if opening the stream fails.
pub fn try_udp<T: ToSocketAddrs>(local: T, server: T) -> IoResult<Self>
[src]
Returns a SyslogConnector
which sends log via the fragile UDP protocol from local to server.
Errors
std::io::Error
if opening the stream fails.
Trait Implementations
impl Write for SyslogConnector
[src]
fn write(&mut self, message: &[u8]) -> IoResult<usize>
[src]
fn flush(&mut self) -> IoResult<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for SyslogConnector
impl Send for SyslogConnector
impl Sync for SyslogConnector
impl Unpin for SyslogConnector
impl UnwindSafe for SyslogConnector
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,