PSP-11640 HOTFIX: Investigate High Log Volume in SILVER 3cd915-test (PIMS API)#5332
Merged
Merged
Conversation
…eparate logging.json file
…g only in local environment
eddherrera
approved these changes
Jun 10, 2026
|
asanchezr
commented
Jun 10, 2026
Comment on lines
-131
to
-134
| var debugLoggerFactory = LoggerFactory.Create(builder => { builder.AddDebug(); }); // NOSONAR | ||
| sql.UseLoggerFactory(debugLoggerFactory); | ||
| options.EnableSensitiveDataLogging(); | ||
| options.LogTo(Console.WriteLine); |
Collaborator
Author
There was a problem hiding this comment.
This was the main reason of extra logging. Regardless of general logging configuration at the application level, this code path was setting up an extra DEBUG logger to log every SQL statement to the console.
asanchezr
commented
Jun 10, 2026
Comment on lines
+2
to
+15
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Information", | ||
| "Microsoft": "Warning", | ||
| "Microsoft.Hosting.Lifetime": "Information", | ||
| "Microsoft.AspNetCore": "Warning", | ||
| "Microsoft.EntityFrameworkCore": "Warning", | ||
| "Microsoft.EntityFrameworkCore.Database.Command": "Warning", | ||
| "System.Net.Http.HttpClient": "Warning", | ||
| "HealthChecks.UI": "Error", | ||
| "Pims.Api.Handlers": "Error", | ||
| "Pims.Core.Api.Middleware": "Warning", | ||
| "Pims.Core.Http": "Warning" | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Production-safe logging configuration
Contributor
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5332 |
asanchezr
commented
Jun 10, 2026
Comment on lines
+2
to
+12
| "Logging": { | ||
| "LogLevel": { | ||
| "Default": "Debug", | ||
| "Microsoft": "Information", | ||
| "Microsoft.EntityFrameworkCore": "Information", | ||
| "Microsoft.EntityFrameworkCore.Database.Command": "Information", | ||
| "System.Net.Http.HttpClient": "Information", | ||
| "Pims.Api.Handlers": "Trace", | ||
| "Pims.Core.Api.Middleware": "Debug", | ||
| "Pims.Core.Http": "Debug" | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
logging.Local.json with the relaxed local levels to enable debugging on developer's machine
Contributor
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5332 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



We've noted a high volume of logs (1,057,738 log entries in the past hour) coming from SILVER namespace 3cd915-test. The problem appears to be coming from pims-api-uat-b99bb55bb-97fmv pod(s).
Action required: Reduce the number of logs.