Alembic
Log once, send anywhere.
Send the same log message to stdout, stderr and a log file at the same time, with a single function call!
Currently supported output sinks:
stdoutstderr- Log file
- Rotation policies (
hourly,daily,weeklyandmonthly)
- Rotation policies (
To-do
- Elasticsearch sink
Example: Write to a stdout and File sink simultaneously
// Create a log handler. Default log level is Error.
let mut logger: Handler = new.unwrap;
// Create stdout and file sink instances
let mut stdout_sink: StdoutSink = new.unwrap;
let mut file_sink: FileSink = new.unwrap;
// Add the sinks to the log handler
logger.add_sink;
logger.add_sink;
// Write some logs!
logger.info
logger.error
The log line format
Log formats are currently non-adjustable. Here is an example log line that is generated by Alembic:
[2025-08-03T14:51:54.936003992-04:00] [DEBUG] [file] There is a bug!
[2025-08-03T14:51:54.936172325-04:00] [INFO] [file] Wow, so informational.
[2025-08-03T14:51:54.936190558-04:00] [WARN] [file] WARNING
[2025-08-03T14:51:54.936206347-04:00] [ERROR] [file] ! ERROR !
[2025-08-03T14:51:54.936221734-04:00] [FATAL] [file] FATALITY.
Building from source
The project is buildable directly via
cargo build
However, we also have a Makefile to make common development actions easier.
make build # development build
make build-release # release build
The Makefile has several other functions defined as well - check the file for a complete accounting of commands.