[][src]Crate slog_mongodb

MongoDB Drain for slog-rs

use slog::*;

let client = mongodb::Client::with_uri_str("mongodb://localhost:27017/").unwrap();
let db = client.database("some_db");
let logs = db.collection("logs");

let drain = slog_mongodb::MongoDBDrain::new(logs, std::time::Duration::from_secs(5)).fuse();
let drain = slog_async::Async::new(drain).build().fuse();

let log = Logger::root(drain, o!());
info!(log, "Hello MongoDB!");

Structs

MongoDBDrain

MongoDB Drain for slog-rs. Buffers incoming log messages and stores them at a configurable time interval.

MongoDBDrainBuilder

MongoDB Drain builder