#[macro_use]
extern crate slog;
extern crate hostname;
extern crate slog_async;
extern crate slog_gelf;
use slog::Drain;
fn main() {
let hostname = hostname::get_hostname().unwrap();
let drain = slog_gelf::Gelf::new(&hostname, "192.168.0.1011:12201")
.unwrap()
.fuse();
let drain = slog_async::Async::new(drain).build().fuse();
let log = slog::Logger::root(drain, o!("key" => "value"));
info!(log,
"An example log message";
"k1" => "v1",
"k2" => "v2",
);
}
-
Notifications
You must be signed in to change notification settings - Fork 5
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
lancastr/slog-gelf
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published