From 415bdc2ff11259562bc202d8adb0f56deb9553bf Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Tue, 6 Feb 2024 16:36:56 +0800 Subject: [PATCH 1/7] Use env var for logging filter, remove otel. --- notary-server/Cargo.toml | 6 +++--- notary-server/README.md | 12 ++++++++++++ notary-server/config/config.yaml | 3 --- notary-server/src/config.rs | 9 --------- notary-server/src/lib.rs | 2 +- notary-server/src/main.rs | 2 +- notary-server/src/server_tracing.rs | 26 +++++++------------------ notary-server/tests/integration_test.rs | 5 +---- 8 files changed, 25 insertions(+), 40 deletions(-) diff --git a/notary-server/Cargo.toml b/notary-server/Cargo.toml index a62e0b9dd..766b01ac0 100644 --- a/notary-server/Cargo.toml +++ b/notary-server/Cargo.toml @@ -28,8 +28,7 @@ serde_yaml = "0.9.21" sha1 = "0.10" structopt = "0.3.26" thiserror = "1" -tlsn-verifier = { path = "../tlsn/tlsn-verifier" } -tlsn-tls-core = { path = "../components/tls/tls-core" } +tlsn-verifier = { path = "../tlsn/tlsn-verifier", features = ["tracing"] } tokio = { version = "1", features = ["full"] } tokio-rustls = { version = "0.24.1" } tokio-util = { version = "0.7", features = ["compat"] } @@ -44,6 +43,7 @@ ws_stream_tungstenite = { version = "0.10.0", features = ["tokio_io"] } [dev-dependencies] # specify vendored feature to use statically linked copy of OpenSSL hyper-tls = { version = "0.5.0", features = ["vendored"] } +tlsn-prover = { path = "../tlsn/tlsn-prover", features = ["tracing"] } tls-server-fixture = { path = "../components/tls/tls-server-fixture" } -tlsn-prover = { path = "../tlsn/tlsn-prover" } +tlsn-tls-core = { path = "../components/tls/tls-core" } tokio-native-tls = { version = "0.3.1", features = ["vendored"] } diff --git a/notary-server/README.md b/notary-server/README.md index bf268d029..ada145bd5 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -82,6 +82,18 @@ To perform notarization using the session id (unique id returned upon calling th ##### Query Parameter Type String +--- +## Debugging +The default logging of this server is set to `DEBUG` verbosity level for all crates (both internal and external) using tracing crate's [EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html). + +To help with debugging, one can use the following environment variable with the command to launch the server (Cargo or Docker): + +`RUST_LOG=notary_server,tlsn_verifier,tls_mpc,tls_client_async=DEBUG` + +This effectively reduces the volume of logs by only including DEBUG-level logs from the crates that are useful for most debugging scenarios. + +One can always modify this env var to include any crate of interest by following tracing crate's [filter directive syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax). + --- ## Architecture ### Objective diff --git a/notary-server/config/config.yaml b/notary-server/config/config.yaml index 71d7577fe..dd2db00c2 100644 --- a/notary-server/config/config.yaml +++ b/notary-server/config/config.yaml @@ -15,9 +15,6 @@ notary-key: private-key-pem-path: "./fixture/notary/notary.key" public-key-pem-path: "./fixture/notary/notary.pub" -tracing: - default-level: DEBUG - authorization: enabled: false whitelist-csv-path: "./fixture/auth/whitelist.csv" diff --git a/notary-server/src/config.rs b/notary-server/src/config.rs index b4b0c3726..838d5fecc 100644 --- a/notary-server/src/config.rs +++ b/notary-server/src/config.rs @@ -11,8 +11,6 @@ pub struct NotaryServerProperties { pub tls: TLSProperties, /// File path of private key (in PEM format) used to sign the notarization pub notary_key: NotarySigningKeyProperties, - /// Setting for logging/tracing - pub tracing: TracingProperties, /// Setting for authorization pub authorization: AuthorizationProperties, } @@ -57,10 +55,3 @@ pub struct NotarySigningKeyProperties { pub private_key_pem_path: String, pub public_key_pem_path: String, } - -#[derive(Clone, Debug, Deserialize)] -#[serde(rename_all = "kebab-case")] -pub struct TracingProperties { - /// The minimum logging level, must be either of - pub default_level: String, -} diff --git a/notary-server/src/lib.rs b/notary-server/src/lib.rs index 8a46a574a..9c948ecec 100644 --- a/notary-server/src/lib.rs +++ b/notary-server/src/lib.rs @@ -9,7 +9,7 @@ mod util; pub use config::{ AuthorizationProperties, NotarizationProperties, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, }; pub use domain::{ cli::CliFields, diff --git a/notary-server/src/main.rs b/notary-server/src/main.rs index 58d8ed3a8..3510c5a08 100644 --- a/notary-server/src/main.rs +++ b/notary-server/src/main.rs @@ -14,7 +14,7 @@ async fn main() -> Result<(), NotaryServerError> { let config: NotaryServerProperties = parse_config_file(&cli_fields.config_file)?; // Set up tracing for logging - init_tracing(&config).map_err(|err| eyre!("Failed to set up tracing: {err}"))?; + init_tracing().map_err(|err| eyre!("Failed to set up tracing: {err}"))?; debug!(?config, "Server config loaded"); diff --git a/notary-server/src/server_tracing.rs b/notary-server/src/server_tracing.rs index 65b5aa8c2..99786aaf2 100644 --- a/notary-server/src/server_tracing.rs +++ b/notary-server/src/server_tracing.rs @@ -1,21 +1,13 @@ use eyre::Result; -use opentelemetry::{ - global, - sdk::{export::trace::stdout, propagation::TraceContextPropagator}, -}; +use tracing::metadata::LevelFilter; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; -use crate::config::NotaryServerProperties; - -pub fn init_tracing(config: &NotaryServerProperties) -> Result<()> { - // Create a new OpenTelemetry pipeline - let tracer = stdout::new_pipeline().install_simple(); - - // Create a tracing layer with the configured tracer - let tracing_layer = tracing_opentelemetry::layer().with_tracer(tracer); - - // Set the log level - let env_filter_layer = EnvFilter::new(&config.tracing.default_level); +pub fn init_tracing() -> Result<()> { + // Retrieve log filter logic from RUST_LOG env var + let env_filter_layer = EnvFilter::builder() + // if RUST_LOG is not set, then set DEBUG level logging for all crates + .with_default_directive(LevelFilter::DEBUG.into()) + .from_env_lossy(); // Format the log let format_layer = tracing_subscriber::fmt::layer() @@ -24,11 +16,7 @@ pub fn init_tracing(config: &NotaryServerProperties) -> Result<()> { .with_thread_ids(true) .with_thread_names(true); - // Set up context propagation - global::set_text_map_propagator(TraceContextPropagator::default()); - Registry::default() - .with(tracing_layer) .with(env_filter_layer) .with(format_layer) .try_init()?; diff --git a/notary-server/tests/integration_test.rs b/notary-server/tests/integration_test.rs index 6aa0e0ca0..5828669cc 100644 --- a/notary-server/tests/integration_test.rs +++ b/notary-server/tests/integration_test.rs @@ -29,7 +29,7 @@ use ws_stream_tungstenite::WsStream; use notary_server::{ read_pem_file, run_server, AuthorizationProperties, NotarizationProperties, NotarizationSessionRequest, NotarizationSessionResponse, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, }; const NOTARY_CA_CERT_PATH: &str = "./fixture/tls/rootCA.crt"; @@ -54,9 +54,6 @@ fn get_server_config(port: u16, tls_enabled: bool) -> NotaryServerProperties { private_key_pem_path: "./fixture/notary/notary.key".to_string(), public_key_pem_path: "./fixture/notary/notary.pub".to_string(), }, - tracing: TracingProperties { - default_level: "DEBUG".to_string(), - }, authorization: AuthorizationProperties { enabled: false, whitelist_csv_path: "./fixture/auth/whitelist.csv".to_string(), From 60a41ab3107ca0a4d707e0b308c5b5ef20448fd2 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Tue, 6 Feb 2024 17:40:21 +0800 Subject: [PATCH 2/7] Fix directives. --- notary-server/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notary-server/README.md b/notary-server/README.md index ada145bd5..3a9f8c29a 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -83,12 +83,12 @@ To perform notarization using the session id (unique id returned upon calling th String --- -## Debugging +## Logging The default logging of this server is set to `DEBUG` verbosity level for all crates (both internal and external) using tracing crate's [EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html). To help with debugging, one can use the following environment variable with the command to launch the server (Cargo or Docker): -`RUST_LOG=notary_server,tlsn_verifier,tls_mpc,tls_client_async=DEBUG` +`RUST_LOG=notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG` This effectively reduces the volume of logs by only including DEBUG-level logs from the crates that are useful for most debugging scenarios. From 956e50cebd6f02eddad97c950ab136b065173541 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Wed, 7 Feb 2024 11:58:49 +0800 Subject: [PATCH 3/7] Revert to using config for logging filter. --- notary-server/README.md | 6 +++--- notary-server/config/config.yaml | 3 +++ notary-server/src/config.rs | 10 ++++++++++ notary-server/src/lib.rs | 2 +- notary-server/src/main.rs | 2 +- notary-server/src/server_tracing.rs | 10 ++++++---- notary-server/tests/integration_test.rs | 5 ++++- 7 files changed, 28 insertions(+), 10 deletions(-) diff --git a/notary-server/README.md b/notary-server/README.md index 3a9f8c29a..a32a49814 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -84,11 +84,11 @@ String --- ## Logging -The default logging of this server is set to `DEBUG` verbosity level for all crates (both internal and external) using tracing crate's [EnvFilter](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html). +The default logging of this server is set to `DEBUG` verbosity level for all crates (both internal and external). -To help with debugging, one can use the following environment variable with the command to launch the server (Cargo or Docker): +To help with debugging, one can use the following logging filter directive in the config [file](./config/config.yaml): -`RUST_LOG=notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG` +`notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG` This effectively reduces the volume of logs by only including DEBUG-level logs from the crates that are useful for most debugging scenarios. diff --git a/notary-server/config/config.yaml b/notary-server/config/config.yaml index dd2db00c2..addb95dcd 100644 --- a/notary-server/config/config.yaml +++ b/notary-server/config/config.yaml @@ -15,6 +15,9 @@ notary-key: private-key-pem-path: "./fixture/notary/notary.key" public-key-pem-path: "./fixture/notary/notary.pub" +tracing: + logging-filter: DEBUG + authorization: enabled: false whitelist-csv-path: "./fixture/auth/whitelist.csv" diff --git a/notary-server/src/config.rs b/notary-server/src/config.rs index 838d5fecc..18048eba5 100644 --- a/notary-server/src/config.rs +++ b/notary-server/src/config.rs @@ -11,6 +11,8 @@ pub struct NotaryServerProperties { pub tls: TLSProperties, /// File path of private key (in PEM format) used to sign the notarization pub notary_key: NotarySigningKeyProperties, + /// Setting for logging/tracing + pub tracing: TracingProperties, /// Setting for authorization pub authorization: AuthorizationProperties, } @@ -55,3 +57,11 @@ pub struct NotarySigningKeyProperties { pub private_key_pem_path: String, pub public_key_pem_path: String, } + +#[derive(Clone, Debug, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub struct TracingProperties { + /// A directive that helps to filter logs that match certain crates/verbosity level + /// Refer to the syntax here https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax + pub logging_filter: String, +} diff --git a/notary-server/src/lib.rs b/notary-server/src/lib.rs index 9c948ecec..8a46a574a 100644 --- a/notary-server/src/lib.rs +++ b/notary-server/src/lib.rs @@ -9,7 +9,7 @@ mod util; pub use config::{ AuthorizationProperties, NotarizationProperties, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, }; pub use domain::{ cli::CliFields, diff --git a/notary-server/src/main.rs b/notary-server/src/main.rs index 3510c5a08..58d8ed3a8 100644 --- a/notary-server/src/main.rs +++ b/notary-server/src/main.rs @@ -14,7 +14,7 @@ async fn main() -> Result<(), NotaryServerError> { let config: NotaryServerProperties = parse_config_file(&cli_fields.config_file)?; // Set up tracing for logging - init_tracing().map_err(|err| eyre!("Failed to set up tracing: {err}"))?; + init_tracing(&config).map_err(|err| eyre!("Failed to set up tracing: {err}"))?; debug!(?config, "Server config loaded"); diff --git a/notary-server/src/server_tracing.rs b/notary-server/src/server_tracing.rs index 99786aaf2..4b54490ad 100644 --- a/notary-server/src/server_tracing.rs +++ b/notary-server/src/server_tracing.rs @@ -2,12 +2,14 @@ use eyre::Result; use tracing::metadata::LevelFilter; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; -pub fn init_tracing() -> Result<()> { - // Retrieve log filter logic from RUST_LOG env var +use crate::config::NotaryServerProperties; + +pub fn init_tracing(config: &NotaryServerProperties) -> Result<()> { + // Retrieve log filter logic from config let env_filter_layer = EnvFilter::builder() - // if RUST_LOG is not set, then set DEBUG level logging for all crates + // if fail to parse log filter, then set DEBUG level logging for all crates .with_default_directive(LevelFilter::DEBUG.into()) - .from_env_lossy(); + .parse_lossy(&config.tracing.logging_filter); // Format the log let format_layer = tracing_subscriber::fmt::layer() diff --git a/notary-server/tests/integration_test.rs b/notary-server/tests/integration_test.rs index 5828669cc..ff6529d22 100644 --- a/notary-server/tests/integration_test.rs +++ b/notary-server/tests/integration_test.rs @@ -29,7 +29,7 @@ use ws_stream_tungstenite::WsStream; use notary_server::{ read_pem_file, run_server, AuthorizationProperties, NotarizationProperties, NotarizationSessionRequest, NotarizationSessionResponse, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, }; const NOTARY_CA_CERT_PATH: &str = "./fixture/tls/rootCA.crt"; @@ -54,6 +54,9 @@ fn get_server_config(port: u16, tls_enabled: bool) -> NotaryServerProperties { private_key_pem_path: "./fixture/notary/notary.key".to_string(), public_key_pem_path: "./fixture/notary/notary.pub".to_string(), }, + tracing: TracingProperties { + logging_filter: "DEBUG".to_string(), + }, authorization: AuthorizationProperties { enabled: false, whitelist_csv_path: "./fixture/auth/whitelist.csv".to_string(), From 0dcf048c7235b4f6911246b63a4bd6cde749f2b0 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Wed, 7 Feb 2024 17:50:50 +0800 Subject: [PATCH 4/7] Modify default logging strategy and make filter optional. --- .../tls/tls-client/src/backend/standard.rs | 2 +- components/tls/tls-client/tests/api.rs | 2 -- notary-server/README.md | 8 +++---- notary-server/config/config.yaml | 4 ++-- notary-server/src/config.rs | 15 +++++++------ notary-server/src/lib.rs | 4 ++-- notary-server/src/server_tracing.rs | 21 ++++++++++++------- notary-server/tests/integration_test.rs | 9 ++++---- 8 files changed, 36 insertions(+), 29 deletions(-) diff --git a/components/tls/tls-client/src/backend/standard.rs b/components/tls/tls-client/src/backend/standard.rs index afd6b7adb..bfa843e1d 100644 --- a/components/tls/tls-client/src/backend/standard.rs +++ b/components/tls/tls-client/src/backend/standard.rs @@ -9,7 +9,7 @@ use p256::{ecdh::EphemeralSecret, EncodedPoint, PublicKey as ECDHPublicKey}; use rand::{rngs::OsRng, thread_rng, Rng}; use digest::Digest; -use std::{any::Any, convert::TryInto, collections::VecDeque}; +use std::{any::Any, collections::VecDeque, convert::TryInto}; use tls_core::{ cert::ServerCertDetails, ke::ServerKxDetails, diff --git a/components/tls/tls-client/tests/api.rs b/components/tls/tls-client/tests/api.rs index 43dd64ae4..6f1f0d0cf 100644 --- a/components/tls/tls-client/tests/api.rs +++ b/components/tls/tls-client/tests/api.rs @@ -14,8 +14,6 @@ use std::{ }, }; - - #[cfg(feature = "quic")] use tls_client::quic::{self, ClientQuicExt, QuicExt, ServerQuicExt}; use tls_client::{ diff --git a/notary-server/README.md b/notary-server/README.md index a32a49814..e43f1b555 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -84,15 +84,13 @@ String --- ## Logging -The default logging of this server is set to `DEBUG` verbosity level for all crates (both internal and external). - -To help with debugging, one can use the following logging filter directive in the config [file](./config/config.yaml): +The default logging strategy of this server is set to `DEBUG` verbosity level for the crates that are useful for most debugging scenarios, i.e. using the following filtering logic `notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG` -This effectively reduces the volume of logs by only including DEBUG-level logs from the crates that are useful for most debugging scenarios. +In the config [file](./config/config.yaml), one can toggle the verbosity level for these crates using the `level` field. -One can always modify this env var to include any crate of interest by following tracing crate's [filter directive syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax). +One can also provide custom filtering logic via the optional `filter` field by following tracing crate's [filter directive syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax). --- ## Architecture diff --git a/notary-server/config/config.yaml b/notary-server/config/config.yaml index addb95dcd..896db873e 100644 --- a/notary-server/config/config.yaml +++ b/notary-server/config/config.yaml @@ -15,8 +15,8 @@ notary-key: private-key-pem-path: "./fixture/notary/notary.key" public-key-pem-path: "./fixture/notary/notary.pub" -tracing: - logging-filter: DEBUG +logging: + level: DEBUG authorization: enabled: false diff --git a/notary-server/src/config.rs b/notary-server/src/config.rs index 18048eba5..94d7b1ee2 100644 --- a/notary-server/src/config.rs +++ b/notary-server/src/config.rs @@ -11,8 +11,8 @@ pub struct NotaryServerProperties { pub tls: TLSProperties, /// File path of private key (in PEM format) used to sign the notarization pub notary_key: NotarySigningKeyProperties, - /// Setting for logging/tracing - pub tracing: TracingProperties, + /// Setting for logging + pub logging: LoggingProperties, /// Setting for authorization pub authorization: AuthorizationProperties, } @@ -60,8 +60,11 @@ pub struct NotarySigningKeyProperties { #[derive(Clone, Debug, Deserialize)] #[serde(rename_all = "kebab-case")] -pub struct TracingProperties { - /// A directive that helps to filter logs that match certain crates/verbosity level - /// Refer to the syntax here https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax - pub logging_filter: String, +pub struct LoggingProperties { + /// Log verbosity level of the default filtering logic, which is notary_server=,tlsn_verifier=,tls_mpc= + /// Must be either of + pub level: String, + /// Custom filtering logic, refer to the syntax here https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax + /// This will override the default filtering logic above + pub filter: Option, } diff --git a/notary-server/src/lib.rs b/notary-server/src/lib.rs index 8a46a574a..df2ac64b5 100644 --- a/notary-server/src/lib.rs +++ b/notary-server/src/lib.rs @@ -8,8 +8,8 @@ mod service; mod util; pub use config::{ - AuthorizationProperties, NotarizationProperties, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, + AuthorizationProperties, LoggingProperties, NotarizationProperties, NotaryServerProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, }; pub use domain::{ cli::CliFields, diff --git a/notary-server/src/server_tracing.rs b/notary-server/src/server_tracing.rs index 4b54490ad..2d7e7bdcb 100644 --- a/notary-server/src/server_tracing.rs +++ b/notary-server/src/server_tracing.rs @@ -1,15 +1,22 @@ use eyre::Result; -use tracing::metadata::LevelFilter; +use std::str::FromStr; +use tracing::Level; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; use crate::config::NotaryServerProperties; pub fn init_tracing(config: &NotaryServerProperties) -> Result<()> { - // Retrieve log filter logic from config - let env_filter_layer = EnvFilter::builder() - // if fail to parse log filter, then set DEBUG level logging for all crates - .with_default_directive(LevelFilter::DEBUG.into()) - .parse_lossy(&config.tracing.logging_filter); + // Retrieve log filtering logic from config + let directives = match &config.logging.filter { + // Use custom filter that is provided by user + Some(filter) => filter.clone(), + // Use the default filter when only verbosity level is provided + None => { + let level = Level::from_str(&config.logging.level)?; + format!("notary_server={level},tlsn_verifier={level},tls_mpc={level}") + } + }; + let filter_layer = EnvFilter::builder().parse(directives)?; // Format the log let format_layer = tracing_subscriber::fmt::layer() @@ -19,7 +26,7 @@ pub fn init_tracing(config: &NotaryServerProperties) -> Result<()> { .with_thread_names(true); Registry::default() - .with(env_filter_layer) + .with(filter_layer) .with(format_layer) .try_init()?; diff --git a/notary-server/tests/integration_test.rs b/notary-server/tests/integration_test.rs index ff6529d22..77613a2d7 100644 --- a/notary-server/tests/integration_test.rs +++ b/notary-server/tests/integration_test.rs @@ -27,9 +27,9 @@ use tracing::debug; use ws_stream_tungstenite::WsStream; use notary_server::{ - read_pem_file, run_server, AuthorizationProperties, NotarizationProperties, + read_pem_file, run_server, AuthorizationProperties, LoggingProperties, NotarizationProperties, NotarizationSessionRequest, NotarizationSessionResponse, NotaryServerProperties, - NotarySigningKeyProperties, ServerProperties, TLSProperties, TracingProperties, + NotarySigningKeyProperties, ServerProperties, TLSProperties, }; const NOTARY_CA_CERT_PATH: &str = "./fixture/tls/rootCA.crt"; @@ -54,8 +54,9 @@ fn get_server_config(port: u16, tls_enabled: bool) -> NotaryServerProperties { private_key_pem_path: "./fixture/notary/notary.key".to_string(), public_key_pem_path: "./fixture/notary/notary.pub".to_string(), }, - tracing: TracingProperties { - logging_filter: "DEBUG".to_string(), + logging: LoggingProperties { + level: "DEBUG".to_string(), + filter: None, }, authorization: AuthorizationProperties { enabled: false, From 3ac497afef9d043d4cbff100be50e3e4457abcad Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Wed, 7 Feb 2024 17:58:27 +0800 Subject: [PATCH 5/7] Revert formatting of other crates. --- components/tls/tls-client/src/backend/standard.rs | 2 +- components/tls/tls-client/tests/api.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/tls/tls-client/src/backend/standard.rs b/components/tls/tls-client/src/backend/standard.rs index bfa843e1d..afd6b7adb 100644 --- a/components/tls/tls-client/src/backend/standard.rs +++ b/components/tls/tls-client/src/backend/standard.rs @@ -9,7 +9,7 @@ use p256::{ecdh::EphemeralSecret, EncodedPoint, PublicKey as ECDHPublicKey}; use rand::{rngs::OsRng, thread_rng, Rng}; use digest::Digest; -use std::{any::Any, collections::VecDeque, convert::TryInto}; +use std::{any::Any, convert::TryInto, collections::VecDeque}; use tls_core::{ cert::ServerCertDetails, ke::ServerKxDetails, diff --git a/components/tls/tls-client/tests/api.rs b/components/tls/tls-client/tests/api.rs index 6f1f0d0cf..43dd64ae4 100644 --- a/components/tls/tls-client/tests/api.rs +++ b/components/tls/tls-client/tests/api.rs @@ -14,6 +14,8 @@ use std::{ }, }; + + #[cfg(feature = "quic")] use tls_client::quic::{self, ClientQuicExt, QuicExt, ServerQuicExt}; use tls_client::{ From 48c9c6208b2c9d089ba535aaec2428cf174227f1 Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Wed, 7 Feb 2024 18:04:36 +0800 Subject: [PATCH 6/7] Update README. --- notary-server/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notary-server/README.md b/notary-server/README.md index e43f1b555..6639d443c 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -84,13 +84,13 @@ String --- ## Logging -The default logging strategy of this server is set to `DEBUG` verbosity level for the crates that are useful for most debugging scenarios, i.e. using the following filtering logic +The default logging strategy of this server is set to `DEBUG` verbosity level for the crates that are useful for most debugging scenarios, i.e. using the following filtering logic, `notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG` -In the config [file](./config/config.yaml), one can toggle the verbosity level for these crates using the `level` field. +In the config [file](./config/config.yaml), one can toggle the verbosity level for these crates using the `level` field under `logging`. -One can also provide custom filtering logic via the optional `filter` field by following tracing crate's [filter directive syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax). +One can also provide custom filtering logic by adding a `filter` field under `logging` in the config file above, and use a value that follows tracing crate's [filter directive syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax). --- ## Architecture From 5a721ebf774d93f6b4440225d0a292aa293051fb Mon Sep 17 00:00:00 2001 From: Christopher Chong Date: Fri, 9 Feb 2024 21:59:03 +0800 Subject: [PATCH 7/7] Update notary-server/README.md Co-authored-by: Hendrik Eeckhaut --- notary-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notary-server/README.md b/notary-server/README.md index 6639d443c..0c194b9a5 100644 --- a/notary-server/README.md +++ b/notary-server/README.md @@ -84,7 +84,7 @@ String --- ## Logging -The default logging strategy of this server is set to `DEBUG` verbosity level for the crates that are useful for most debugging scenarios, i.e. using the following filtering logic, +The default logging strategy of this server is set to `DEBUG` verbosity level for the crates that are useful for most debugging scenarios, i.e. using the following filtering logic: `notary_server=DEBUG,tlsn_verifier=DEBUG,tls_mpc=DEBUG,tls_client_async=DEBUG`