Skip to content

PSP-11640 HOTFIX: Investigate High Log Volume in SILVER 3cd915-test (PIMS API)#5332

Merged
asanchezr merged 4 commits into
bcgov:testfrom
asanchezr:psp-11640-reduce-logging
Jun 10, 2026
Merged

PSP-11640 HOTFIX: Investigate High Log Volume in SILVER 3cd915-test (PIMS API)#5332
asanchezr merged 4 commits into
bcgov:testfrom
asanchezr:psp-11640-reduce-logging

Conversation

@asanchezr

Copy link
Copy Markdown
Collaborator

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.

image

@asanchezr asanchezr self-assigned this Jun 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

Comment on lines -131 to -134
var debugLoggerFactory = LoggerFactory.Create(builder => { builder.AddDebug(); }); // NOSONAR
sql.UseLoggerFactory(debugLoggerFactory);
options.EnableSensitiveDataLogging();
options.LogTo(Console.WriteLine);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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"
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Production-safe logging configuration

@github-actions

Copy link
Copy Markdown
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5332

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"
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging.Local.json with the relaxed local levels to enable debugging on developer's machine

@github-actions

Copy link
Copy Markdown
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5332

@asanchezr asanchezr merged commit e5d527d into bcgov:test Jun 10, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants