From abc9a2361e247e6c6f88a11b1fe59500c46ebe14 Mon Sep 17 00:00:00 2001 From: Aayush Maini Date: Wed, 7 Jan 2026 14:52:55 -0800 Subject: [PATCH 1/4] Reduce log level for per file level logs in RustSbomDetector --- .../rust/RustSbomDetector.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs b/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs index ac8d79c88..bbae3833b 100644 --- a/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs +++ b/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs @@ -252,7 +252,7 @@ protected override async Task OnFileFoundAsync( var normDirectory = this.pathUtilityService.NormalizePath(directory); var fileName = Path.GetFileName(location); - this.Logger.LogInformation("Processing file: {Location}", normLocation); + this.Logger.LogDebug("Processing file: {Location}", normLocation); // Determine file kind FileKind fileKind; @@ -272,7 +272,7 @@ protected override async Task OnFileFoundAsync( // Check if directory should be skipped if (this.ShouldSkip(directory, fileKind, location)) { - this.Logger.LogInformation("Skipping file due to skip rules: {Location}", normLocation); + this.Logger.LogDebug("Skipping file due to skip rules: {Location}", normLocation); // Increment skip counters switch (fileKind) From 4808c876fdd149334ce98086e71af8c0f75cd11e Mon Sep 17 00:00:00 2001 From: Aayush Maini Date: Wed, 7 Jan 2026 15:00:32 -0800 Subject: [PATCH 2/4] Reduce log level for fallback ownership --- .../rust/Parsers/RustSbomParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.ComponentDetection.Detectors/rust/Parsers/RustSbomParser.cs b/src/Microsoft.ComponentDetection.Detectors/rust/Parsers/RustSbomParser.cs index b377ef664..5763fb462 100644 --- a/src/Microsoft.ComponentDetection.Detectors/rust/Parsers/RustSbomParser.cs +++ b/src/Microsoft.ComponentDetection.Detectors/rust/Parsers/RustSbomParser.cs @@ -265,7 +265,7 @@ private void ApplyOwners( if (!ownersApplied) { - this.logger.LogWarning("Falling back to SBOM recorder for {Id} because no ownership found", id); + this.logger.LogDebug("Falling back to SBOM recorder for {Id} because no ownership found", id); // Fallback to SBOM recorder if no ownership info fallbackRecorder.RegisterUsage( From 1e4c1c967593f978230c6e23c03fda9a97dc5b89 Mon Sep 17 00:00:00 2001 From: Aayush Maini Date: Wed, 7 Jan 2026 15:14:21 -0800 Subject: [PATCH 3/4] Fix RustSbom UTs --- .../RustSbomParserTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.ComponentDetection.Detectors.Tests/RustSbomParserTests.cs b/test/Microsoft.ComponentDetection.Detectors.Tests/RustSbomParserTests.cs index 04ac761ea..eb59151f0 100644 --- a/test/Microsoft.ComponentDetection.Detectors.Tests/RustSbomParserTests.cs +++ b/test/Microsoft.ComponentDetection.Detectors.Tests/RustSbomParserTests.cs @@ -824,7 +824,7 @@ await this.parser.ParseWithOwnershipAsync( // Verify logger warning was called this.logger.Verify( x => x.Log( - LogLevel.Warning, + LogLevel.Debug, It.IsAny(), It.Is((v, t) => v.ToString().Contains("Falling back to SBOM recorder")), It.IsAny(), @@ -847,7 +847,7 @@ await this.parser.ParseWithOwnershipAsync( // Verify logger warning was called this.logger.Verify( x => x.Log( - LogLevel.Warning, + LogLevel.Debug, It.IsAny(), It.Is((v, t) => v.ToString().Contains("Falling back to SBOM recorder")), It.IsAny(), From 02cdee5af46ddfcffea464b1cf8912c249b43ddf Mon Sep 17 00:00:00 2001 From: Aayush Maini Date: Wed, 7 Jan 2026 15:39:30 -0800 Subject: [PATCH 4/4] CR: Remove unecessary log --- .../rust/RustSbomDetector.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs b/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs index bbae3833b..9212af429 100644 --- a/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs +++ b/src/Microsoft.ComponentDetection.Detectors/rust/RustSbomDetector.cs @@ -252,8 +252,6 @@ protected override async Task OnFileFoundAsync( var normDirectory = this.pathUtilityService.NormalizePath(directory); var fileName = Path.GetFileName(location); - this.Logger.LogDebug("Processing file: {Location}", normLocation); - // Determine file kind FileKind fileKind; if (fileName.Equals(CargoTomlFileName, this.pathComparison))