Skip to content

Commit fdec4db

Browse files
Change default logging level from WARN to INFO. (#1605)
Fixes #1244 - Purpose: Improve visibility of important operational messages (mount success, location) without requiring --debug flag - Users can now see essential mount information by default ### What changed and why? 1. Default Logging Level: - Changed default logging level from WARN to INFO in cli.rs - Added test_info_level_logging to verify the change - Default INFO logs now show important operational messages: INFO ThreadId(01) mountpoint_s3::cli: target network throughput 10 Gbps INFO ThreadId(01) fuser::session: Mounting /tmp/test-mount-new INFO ThreadId(01) mountpoint_s3::run: successfully mounted bucket 2. Metrics Logging: - Metrics now show when either --log-metrics is set OR debug level is enabled - Explicitly turn off metrics when neither condition is met 3. Log Level Optimization: - Changed setattr logging from INFO to DEBUG level as it's implementation detail is more appropriate for debugging rather than regular operation ### Does this change impact existing behavior? - All existing log levels (--debug, --no-log) continue to work as before - Only changes the default level to show more information - Setattr logging moved to DEBUG level to reduce noise ### Does this change need a changelog entry? Does it require a version change? - Changelog entries added: * mountpoint-s3: Change default logging level from WARN to INFO to improve visibility of important operational messages * mountpoint-s3-fs: Downgrade setattr logging level from INFO to DEBUG to reduce log noise - Version changes: * mountpoint-s3: v1.20.0 -> v1.21.0 (for default logging level change) * mountpoint-s3-fs: v0.7.1 -> v0.7.2 (for setattr logging change) --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). --------- Signed-off-by: Priyanka Karumuru <prikaru@amazon.com>
1 parent 175c3ba commit fdec4db

8 files changed

Lines changed: 45 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mountpoint-s3-fs/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Unreleased
1+
## Unreleased (v0.7.2)
2+
3+
* Downgrade setattr logging level from INFO to DEBUG to reduce log noise. ([#1605](https://github.com/awslabs/mountpoint-s3/pull/1605))
24

35
## v0.7.1 (September 15, 2025)
46

mountpoint-s3-fs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mountpoint-s3-fs"
33
# See `/doc/PUBLISHING_CRATES.md` to read how to publish new versions.
4-
version = "0.7.1"
4+
version = "0.7.2"
55
edition = "2024"
66
license = "Apache-2.0"
77
repository = "https://github.com/awslabs/mountpoint-s3"

mountpoint-s3-fs/src/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ where
324324
size: Option<u64>,
325325
_flags: Option<u32>,
326326
) -> Result<Attr, Error> {
327-
tracing::info!(
327+
tracing::debug!(
328328
"fs:setattr with ino {:?} flags {:?} atime {:?} mtime {:?} size {:?}",
329329
ino,
330330
_flags,

mountpoint-s3/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## Unreleased
1+
## Unreleased (v1.21.0)
2+
3+
* Change default logging level from WARN to INFO to improve visibility of important operational messages. ([#1605](https://github.com/awslabs/mountpoint-s3/pull/1605))
24

35
## v1.20.0 (Sep 12, 2025)
46

mountpoint-s3/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "mountpoint-s3"
3-
version = "1.20.0"
3+
version = "1.21.0"
44
edition = "2024"
55
license = "Apache-2.0"
66
publish = false
77
default-run = "mount-s3"
88

99
[dependencies]
10-
mountpoint-s3-fs = { path = "../mountpoint-s3-fs", version = "0.7.1" }
10+
mountpoint-s3-fs = { path = "../mountpoint-s3-fs", version = "0.7.2" }
1111
mountpoint-s3-client = { path = "../mountpoint-s3-client", version = "0.19.1" }
1212

1313
anyhow = { version = "1.0.98", features = ["backtrace"] }

mountpoint-s3/src/cli.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,14 @@ impl CliArgs {
669669
let mut filter = if self.debug {
670670
String::from("debug")
671671
} else {
672-
String::from("warn")
672+
String::from("info")
673673
};
674674
let crt_verbosity = if self.debug_crt { "debug" } else { "off" };
675675
filter.push_str(&format!(",{AWSCRT_LOG_TARGET}={crt_verbosity}"));
676-
if self.log_metrics {
677-
filter.push_str(&format!(",{}=info", metrics::TARGET_NAME));
676+
// Only turn off metrics if neither --log-metrics nor --debug is set.
677+
// In debug mode, we want to see all available information including metrics.
678+
if !self.log_metrics && !self.debug {
679+
filter.push_str(&format!(",{}=off", metrics::TARGET_NAME));
678680
}
679681
filter
680682
};

mountpoint-s3/tests/fork_test.rs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use aws_sdk_s3::primitives::ByteStream;
88
use fuser::MountOption;
99
use predicates::prelude::*;
1010
use std::fs::{self, File};
11-
#[cfg(not(feature = "s3express_tests"))]
1211
use std::io::Read;
1312
use std::io::{self, BufRead, BufReader, Cursor, Write};
1413
use std::os::fd::AsRawFd;
@@ -194,6 +193,34 @@ fn run_in_foreground() -> Result<(), Box<dyn std::error::Error>> {
194193
Ok(())
195194
}
196195

196+
#[test]
197+
fn test_info_level_logging() -> Result<(), Box<dyn std::error::Error>> {
198+
let (bucket, prefix) = get_test_bucket_and_prefix("test_info_logging");
199+
let region = get_test_region();
200+
let mount_point = assert_fs::TempDir::new()?;
201+
202+
let mut cmd = Command::cargo_bin("mount-s3")?;
203+
cmd.arg(&bucket)
204+
.arg(mount_point.path())
205+
.arg(format!("--prefix={prefix}"))
206+
.arg("--foreground")
207+
.arg(format!("--region={region}"))
208+
.env("RUST_LOG", "info")
209+
.stdout(Stdio::piped());
210+
211+
if let Some(endpoint_url) = get_test_endpoint_url() {
212+
cmd.arg(format!("--endpoint-url={endpoint_url}"));
213+
}
214+
215+
let child = cmd.spawn().unwrap();
216+
217+
let expected_log_pattern = regex::Regex::new(r"INFO").unwrap();
218+
219+
unmount_and_check_log(child, mount_point.path(), &expected_log_pattern);
220+
221+
Ok(())
222+
}
223+
197224
#[test]
198225
fn run_in_foreground_with_passed_fuse_fd() -> Result<(), Box<dyn std::error::Error>> {
199226
let (bucket, prefix) = get_test_bucket_and_prefix("run_in_foreground_with_passed_fuse_fd");
@@ -1200,7 +1227,6 @@ fn unmount(mount_point: &Path) {
12001227
panic!("failed to unmount");
12011228
}
12021229

1203-
#[cfg(not(feature = "s3express_tests"))]
12041230
fn unmount_and_check_log(mut process: Child, mount_path: &Path, expected_log_line: &regex::Regex) {
12051231
unmount(mount_path);
12061232
let mut stdout = process

0 commit comments

Comments
 (0)