diff --git a/boot_node/src/lib.rs b/boot_node/src/lib.rs index f066b6e41..2a5546663 100644 --- a/boot_node/src/lib.rs +++ b/boot_node/src/lib.rs @@ -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 { diff --git a/lighthouse/environment/src/lib.rs b/lighthouse/environment/src/lib.rs index 549eeb089..81e8eee60 100644 --- a/lighthouse/environment/src/lib.rs +++ b/lighthouse/environment/src/lib.rs @@ -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 { @@ -129,7 +130,9 @@ impl EnvironmentBuilder { 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 EnvironmentBuilder { 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 EnvironmentBuilder { 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 EnvironmentBuilder { 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 {