[][src]Enum flexi_logger::writers::SyslogConnector

pub enum SyslogConnector {
    Stream(BufWriter<UnixStream>),
    Datagram(UnixDatagram),
    Udp(UdpSocket),
    Tcp(BufWriter<TcpStream>),
}

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

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.

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]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.