Registry / logging / syslog

syslog

JSON →
library7.0.0rscratesunverified

Formats and writes syslog messages to Unix sockets, UDP, or TCP exporters.

# Cargo.toml [dependencies] syslog = "7.0.0"
INSTALL
IMPORT
SIG · SYSLOG
S
syslog
loggingrustv7.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Facility
use syslog::Facility;

Initialize a syslog logger with RFC 3164 formatting.

use syslog::{Facility, Formatter3164, Logger, BasicLogger}; use log::SetLoggerError; fn init_logger() -> Result<(), SetLoggerError> { let formatter = Formatter3164 { facility: Facility::LOG_USER, hostname: None, process: "myapp".into(), pid: 0, }; let logger = Logger::new(formatter, syslog::unix()).unwrap(); log::set_boxed_logger(Box::new(BasicLogger::new(logger))).map(|()| log::set_max_level(log::LevelFilter::Info)) }
Debug
Known issues
gotchaUnix socket path may not exist on all systems; fallback to UDP/TCP may be needed.
fix
Use `syslog::tcp()` or `syslog::udp()` for remote syslog servers.
affects: *
Upgrade
Version history
7.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
28
Resources
syslog — cargo add syslog · libregistry