Simple and multithreading TCP/UDP logger. It writes data to a plain text file and it also provides additional functionalities such as log file rotation, control the number of rotated files, etc.
Written in Rust language.
Jon Postel in 1994, with map of Internet top-level domains.
- Rust stable (Edition 2021)
 
rustup install stable
rustup default stableRun from the terminal:
RUST_LOG=info cargo run- Press Ctrl+C to gracefully stop the server.
 
The config is written in TOML.
Default config is set in ./config/default.toml.
Optionally you can add a config file by environment setting RUN_MODE={development|production|anything} in your environment and providing the appropriate file: ./config/{development|production|anything}.toml
You can provide environment variable to define log level and override configuration:
- Log level: 
RUST_LOG={debug|info|warn|error}. You can set per-module levels:RUST_LOG=writer=debugenables debug for thewritermodule. - Override config: define variables with a prefix of 
APP_. Eg: 
APP_filewriter_rotation_policy=ByDay would set:
[filewriter.rotation]
policy = "ByDay"Running with inline environment variable from the terminal:
RUST_LOG=info APP_filewriter_rotation_policy=ByDuration cargo runExecute from the terminal:
cargo testSimple UDP sender (sends N messages):
cargo run --example send_via_udp -- 127.0.0.1:8080 1000Minimal logging client (UDP or TCP) for a duration:
cargo run --example logging_client -- --address 127.0.0.1:8080 --duration 10
cargo run --example logging_client -- --address 127.0.0.1:8080 --duration 10 --tcpApache-2.0
