Struct gelf::UdpBackend
source · pub struct UdpBackend { /* private fields */ }
Expand description
UdpBackend is the default and standard GELF backend
It pushes messages to a GELF host via UDP. Messages are cut into chunks of a certain chunk-size. This size is important since the chunk-size + a stable overhead of 12 bytes needs to fit the transport layer’s mtu.
If the message fits into a single chunk, no chunking is applied.
Implementations
sourceimpl UdpBackend
impl UdpBackend
sourcepub fn new<T: ToSocketAddrs>(destination: T) -> Result<UdpBackend>
pub fn new<T: ToSocketAddrs>(destination: T) -> Result<UdpBackend>
Construct a new UdpBackend with default chunk-size (ChunkSize::LAN)
sourcepub fn new_with_chunksize<T: ToSocketAddrs>(
destination: T,
chunk_size: ChunkSize
) -> Result<UdpBackend>
pub fn new_with_chunksize<T: ToSocketAddrs>(
destination: T,
chunk_size: ChunkSize
) -> Result<UdpBackend>
Construct an new UdpBackend with the given chunk-size
sourcepub fn compression(&self) -> MessageCompression
pub fn compression(&self) -> MessageCompression
Return the current set compression algorithm
sourcepub fn set_compression(&mut self, compression: MessageCompression) -> &mut Self
pub fn set_compression(&mut self, compression: MessageCompression) -> &mut Self
Set the compression algorithm
Trait Implementations
sourceimpl Backend for UdpBackend
impl Backend for UdpBackend
sourcefn log_message(&self, msg: WireMessage<'_>) -> Result<()>
fn log_message(&self, msg: WireMessage<'_>) -> Result<()>
Log a message via UDP.
Auto Trait Implementations
impl RefUnwindSafe for UdpBackend
impl Send for UdpBackend
impl Sync for UdpBackend
impl Unpin for UdpBackend
impl UnwindSafe for UdpBackend
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more