Increase logging channel capacity (#1570)
## Issue Addressed #1464 ## Proposed Changes Increase the slog-async log channel size from the default of 128 to 2048 to reduce the number of dropped logs. ## Additional Info
This commit is contained in:
parent
adea7992f8
commit
c34e8efb12
@ -9,6 +9,8 @@ mod server;
|
||||
pub use cli::cli_app;
|
||||
use config::BootNodeConfig;
|
||||
|
||||
const LOG_CHANNEL_SIZE: usize = 2048;
|
||||
|
||||
/// Run the bootnode given the CLI configuration.
|
||||
pub fn run(matches: &ArgMatches<'_>, debug_level: String) {
|
||||
let debug_level = match debug_level.as_str() {
|
||||
@ -26,7 +28,9 @@ pub fn run(matches: &ArgMatches<'_>, debug_level: String) {
|
||||
let decorator = slog_term::TermDecorator::new().build();
|
||||
let decorator = logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
|
||||
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||
slog_async::Async::new(drain).build()
|
||||
slog_async::Async::new(drain)
|
||||
.chan_size(LOG_CHANNEL_SIZE)
|
||||
.build()
|
||||
};
|
||||
|
||||
let drain = match debug_level {
|
||||
|
@ -29,6 +29,7 @@ mod executor;
|
||||
mod metrics;
|
||||
|
||||
pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
|
||||
const LOG_CHANNEL_SIZE: usize = 2048;
|
||||
|
||||
/// Builds an `Environment`.
|
||||
pub struct EnvironmentBuilder<E: EthSpec> {
|
||||
@ -129,7 +130,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
|
||||
match format.to_uppercase().as_str() {
|
||||
"JSON" => {
|
||||
let drain = slog_json::Json::default(std::io::stdout()).fuse();
|
||||
slog_async::Async::new(drain).build()
|
||||
slog_async::Async::new(drain)
|
||||
.chan_size(LOG_CHANNEL_SIZE)
|
||||
.build()
|
||||
}
|
||||
_ => return Err("Logging format provided is not supported".to_string()),
|
||||
}
|
||||
@ -138,7 +141,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
|
||||
let decorator =
|
||||
logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
|
||||
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||
slog_async::Async::new(drain).build()
|
||||
slog_async::Async::new(drain)
|
||||
.chan_size(LOG_CHANNEL_SIZE)
|
||||
.build()
|
||||
};
|
||||
|
||||
let drain = match debug_level {
|
||||
@ -192,7 +197,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
|
||||
match format.to_uppercase().as_str() {
|
||||
"JSON" => {
|
||||
let drain = slog_json::Json::default(file).fuse();
|
||||
slog_async::Async::new(drain).build()
|
||||
slog_async::Async::new(drain)
|
||||
.chan_size(LOG_CHANNEL_SIZE)
|
||||
.build()
|
||||
}
|
||||
_ => return Err("Logging format provided is not supported".to_string()),
|
||||
}
|
||||
@ -201,7 +208,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
|
||||
let decorator =
|
||||
logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
|
||||
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||
slog_async::Async::new(drain).build()
|
||||
slog_async::Async::new(drain)
|
||||
.chan_size(LOG_CHANNEL_SIZE)
|
||||
.build()
|
||||
};
|
||||
|
||||
let drain = match debug_level {
|
||||
|
Loading…
Reference in New Issue
Block a user