pub struct SyslogWriter { /* private fields */ }
Available on crate feature syslog_writer only.
Expand description

A configurable LogWriter implementation that writes log messages to the syslog (see RFC 5424).

Only available with optional crate feature syslog_writer.

See the writers module for guidance how to use additional log writers.

Implementations§

source§

impl SyslogWriter

source

pub fn try_new( facility: SyslogFacility, determine_severity: Option<LevelToSyslogSeverity>, max_log_level: LevelFilter, message_id: String, syslog: Syslog ) -> IoResult<Box<Self>>

Returns a configured boxed instance.

Parameters

facility: An value representing a valid syslog facility value according to RFC 5424.

determine_severity: (optional) A function that maps the rust log levels to the syslog severities. If None is given, a trivial default mapping is used, which should be good enough in most cases.

message_id: The value being used as syslog’s MSGID, which should identify the type of message. The value itself is a string without further semantics. It is intended for filtering messages on a relay or collector.

syslog: A Syslog.

Errors

std::io::Error

source

pub fn try_new_bsd( facility: SyslogFacility, determine_severity: Option<LevelToSyslogSeverity>, max_log_level: LevelFilter, syslog: Syslog ) -> IoResult<Box<Self>>

Returns a configured boxed instance.

Parameters

facility: An value representing a valid syslog facility value according to RFC 5424.

determine_severity: (optional) A function that maps the rust log levels to the syslog severities. If None is given, a trivial default mapping is used, which should be good enough in most cases.

message_id: The value being used as syslog’s MSGID, which should identify the type of message. The value itself is a string without further semantics. It is intended for filtering messages on a relay or collector.

syslog: A Syslog.

Errors

std::io::Error

Trait Implementations§

source§

impl LogWriter for SyslogWriter

source§

fn write(&self, now: &mut DeferredNow, record: &Record<'_>) -> IoResult<()>

Writes out a log line. Read more
source§

fn flush(&self) -> IoResult<()>

Flushes any buffered records. Read more
source§

fn max_log_level(&self) -> LevelFilter

Provides the maximum log level that is to be written.
source§

fn format(&mut self, format: FormatFunction)

Sets the format function. Read more
source§

fn shutdown(&self)

Cleanup open resources, if necessary.
source§

fn reopen_output(&self) -> Result<(), FlexiLoggerError>

Re-open the current output, if meaningful. Read more
source§

fn rotate(&self) -> Result<(), FlexiLoggerError>

Rotate the current output, if meaningful. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more