Crate fasyslog

Source
Expand description

fasyslog is a fast syslog client written in Rust.

§Overview

This crate provides facilities to send log messages via syslog. Support implementations:

§Example

Send a message to a remote syslog server:

let mut sender = fasyslog::sender::tcp_well_known().unwrap();
sender
    .send_rfc3164(fasyslog::Severity::INFORMATIONAL, "Hello, syslog!")
    .unwrap();
sender.flush().unwrap();

let mut element = fasyslog::SDElement::new("exampleSDID@32473").unwrap();
element.add_param("iut", "3").unwrap();
sender
    .send_rfc5424(
        fasyslog::Severity::NOTICE,
        Some("TCPIN"),
        vec![element],
        "Hello, syslog!",
    )
    .unwrap();
sender.flush().unwrap();

Modules§

format
Format Syslog messages according to the referred standards.
sender
Send syslog messages to a syslog server.

Structs§

SDElement
A structured data element.
SDParam
A structured data parameter.

Enums§

Facility
Syslog facility as defined in RFC 5424 (The Syslog Protocol).
Severity
Syslog severity as defined in RFC 5424 (The Syslog Protocol).