mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Ensure logfile permissions are maintained after rotation (#7246)
Update our `logroller` dependency to the new version which supports permission control. See -> https://github.com/trayvonpan/logroller/pull/6
This commit is contained in:
@@ -59,6 +59,7 @@ impl tracing_core::field::Visit for LogMessageExtractor {
|
||||
pub fn create_libp2p_discv5_tracing_layer(
|
||||
base_tracing_log_path: Option<PathBuf>,
|
||||
max_log_size: u64,
|
||||
file_mode: u32,
|
||||
) -> Option<Libp2pDiscv5TracingLayer> {
|
||||
if let Some(mut tracing_log_path) = base_tracing_log_path {
|
||||
// Ensure that `tracing_log_path` only contains directories.
|
||||
@@ -75,12 +76,14 @@ pub fn create_libp2p_discv5_tracing_layer(
|
||||
let libp2p_writer =
|
||||
LogRollerBuilder::new(tracing_log_path.clone(), PathBuf::from("libp2p.log"))
|
||||
.rotation(Rotation::SizeBased(RotationSize::MB(max_log_size)))
|
||||
.max_keep_files(1);
|
||||
.max_keep_files(1)
|
||||
.file_mode(file_mode);
|
||||
|
||||
let discv5_writer =
|
||||
LogRollerBuilder::new(tracing_log_path.clone(), PathBuf::from("discv5.log"))
|
||||
.rotation(Rotation::SizeBased(RotationSize::MB(max_log_size)))
|
||||
.max_keep_files(1);
|
||||
.max_keep_files(1)
|
||||
.file_mode(file_mode);
|
||||
|
||||
let libp2p_writer = match libp2p_writer.build() {
|
||||
Ok(writer) => writer,
|
||||
|
||||
Reference in New Issue
Block a user