1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2024 FastLabs Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! `fasyslog` is a fast syslog client written in Rust.
//!
//! # Overview
//!
//! This crate provides facilities to send log messages via syslog. Support implementations:
//!
//! * [RFC-3164 Formatter]: [The BSD syslog Protocol](https://datatracker.ietf.org/doc/html/rfc3164)
//! * [RFC-5424 Formatter]: [The Syslog Protocol](https://datatracker.ietf.org/doc/html/rfc5424)
//! * [`UdpSender`]: [RFC 5426 - Transmission of Syslog Messages over UDP](https://datatracker.ietf.org/doc/html/rfc5426)
//! * [`TcpSender`]: [RFC 6587 - Transmission of Syslog Messages over TCP](https://datatracker.ietf.org/doc/html/rfc6587)
//! * [`NativeTlsSender`]: [RFC 5425 - Transport Layer Security (TLS) Transport Mapping for Syslog](https://datatracker.ietf.org/doc/html/rfc5425)
//! * This implementation is based on [`native-tls`](https://crates.io/crates/native-tls) and
//! requires features `native-tls` turned on.
//! * [`RustlsSender`]: [RFC 5425 - Transport Layer Security (TLS) Transport Mapping for Syslog](https://datatracker.ietf.org/doc/html/rfc5425)
//! * This implementation is based on [`rustls`](https://crates.io/crates/rustls) and requires
//! features `rustls` turned on.
//! * (unix only) Unix domain socket sender (datagram or stream)
//!
//! [RFC-3164 Formatter]: format::RFC3164Formatter
//! [RFC-5424 Formatter]: format::RFC5424Formatter
//! [`UdpSender`]: sender::UdpSender
//! [`TcpSender`]: sender::TcpSender
//! [`NativeTlsSender`]: sender::NativeTlsSender
//! [`RustlsSender`]: sender::RustlsSender
//!
//! # Example
//!
//! Send a message to a remote syslog server:
//!
//! ```rust, no_run
//! 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();
//! ```
pub use *;
pub use *;
pub use *;