Function gelf_logger::init_from_file
source · pub fn init_from_file(path: &str) -> Result<(), Error>
Expand description
Initialize the logger using a configuration file.
§Warning
The logging system may only be initialized once.
§Example
use gelf_logger::Config;
use log::info;
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 !");