[][src]Function gelf_logger::init_from_file

pub fn init_from_file(path: &str) -> Result<(), Error>

Initialize the logger using a configuration file.

Warning

The logging system may only be initialized once.

Example

use gelf_logger::Config;

fn main() {
    let cfg = Config::try_from_yaml("/tmp/myconfig.yml").unwrap();
    gelf_logger::init(cfg).unwrap();

    info!("hello");

    gelf_logger::flush().expect("Failed to send buffer, log records can be lost !");
}