Closed tailhook closed 9 years ago
There are three different loggers: Unix socket, remote UDP and remote TCP, so I cannot have one init()
methods, there are three such methods.
I'll add the set_logger
call to those initialization methods.
@Geal, sure three methods is ok. It's also probably nice to integrate with fern
too (presumably under feature flag), because fern
can write to multiple loggers at once.
Hi! Please tell me i this works ok for you.
log::set_logger(|max_level| {
max_level.set(LogLevel::Debug.to_log_level_filter());
unix(facility)
})
At least I have not found any other way of setting log level in rust. And both env_logger
and fern
does the same.
Aug 07 17:52:57 basin write[5579]: 2015-08-07T14:52:57Z localhost write[5579]: test error
I.e. duplicate date, host, application, pid. First ones are added by syslog daemon itself i.e. systemd
in my case. In python app I get this:
Aug 07 18:17:01 basin myapp[9053]: error
What is exactly what expected. And what python sends to syslog is just "<11>myapp: error\0"
. I.e. my custom application name without pid, host, datetime.
It seems this crate have
Log
implemented but does noinit()
method. Is this intentional? Should I uselog::set_logger
with a lambda directly? (Thelog
crate does not recommend this)