Replace logging backend to log4rs and add log rotation (#1789)

* Replace logging backend to flexi-logger and add log rotation
* Changed flexi_logger to log4rs
* Disable logging level filtering in Root logger
* Support different logging levels for file and stdout
* Don't log messages from modules other than Grin-related
* Fix formatting
* Place backed up compressed log copies into log file directory
* Increase default log file size to 16 MiB
* Add comment to config file on log_max_size option
This commit is contained in:
eupn
2018-10-21 23:30:56 +03:00
committed by Ignotus Peverell
parent 0852b0c4cf
commit 1195071f5b
83 changed files with 582 additions and 897 deletions
+5 -9
View File
@@ -28,8 +28,8 @@ use util::{Mutex, RwLock};
use common::api;
use common::serde_json;
use store;
use util;
use util::secp::pedersen::Commitment;
use util::{self, LOGGER};
use common::failure::ResultExt;
@@ -146,7 +146,7 @@ where
thread::sleep(Duration::from_millis(10));
// read queue
let m = self.rx.recv().unwrap();
trace!(LOGGER, "Wallet Client Proxy Received: {:?}", m);
trace!("Wallet Client Proxy Received: {:?}", m);
let resp = match m.method.as_ref() {
"get_chain_height" => self.get_chain_height(m)?,
"get_outputs_from_node" => self.get_outputs_from_node(m)?,
@@ -345,7 +345,7 @@ impl WalletClient for LocalWalletClient {
}
let r = self.rx.lock();
let m = r.recv().unwrap();
trace!(LOGGER, "Received send_tx_slate response: {:?}", m.clone());
trace!("Received send_tx_slate response: {:?}", m.clone());
Ok(
serde_json::from_str(&m.body).context(libwallet::ErrorKind::ClientCallback(
"Parsing send_tx_slate response",
@@ -369,7 +369,7 @@ impl WalletClient for LocalWalletClient {
}
let r = self.rx.lock();
let m = r.recv().unwrap();
trace!(LOGGER, "Received post_tx response: {:?}", m.clone());
trace!("Received post_tx response: {:?}", m.clone());
Ok(())
}
@@ -389,11 +389,7 @@ impl WalletClient for LocalWalletClient {
}
let r = self.rx.lock();
let m = r.recv().unwrap();
trace!(
LOGGER,
"Received get_chain_height response: {:?}",
m.clone()
);
trace!("Received get_chain_height response: {:?}", m.clone());
Ok(m.body
.parse::<u64>()
.context(libwallet::ErrorKind::ClientCallback(