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:
+2
-3
@@ -26,7 +26,6 @@ use core::pow::Difficulty;
|
||||
use core::ser::{self, Readable, Reader, Writeable, Writer};
|
||||
|
||||
use types::{Capabilities, Error, ReasonForBan, MAX_BLOCK_HEADERS, MAX_LOCATORS, MAX_PEER_ADDRS};
|
||||
use util::LOGGER;
|
||||
|
||||
/// Current latest version of the protocol
|
||||
pub const PROTOCOL_VERSION: u32 = 1;
|
||||
@@ -207,8 +206,8 @@ pub fn read_header(conn: &mut TcpStream, msg_type: Option<Type>) -> Result<MsgHe
|
||||
// TODO 4x the limits for now to leave ourselves space to change things
|
||||
if header.msg_len > max_len * 4 {
|
||||
error!(
|
||||
LOGGER,
|
||||
"Too large read {}, had {}, wanted {}.", header.msg_type as u8, max_len, header.msg_len
|
||||
"Too large read {}, had {}, wanted {}.",
|
||||
header.msg_type as u8, max_len, header.msg_len
|
||||
);
|
||||
return Err(Error::Serialization(ser::Error::TooLargeReadErr));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user