Skip to content

Structured Logging (Service Project)#1666

Merged
seantleonard merged 3 commits intomainfrom
dev/seantleonard/structuredLogging_Service_config
Sep 6, 2023
Merged

Structured Logging (Service Project)#1666
seantleonard merged 3 commits intomainfrom
dev/seantleonard/structuredLogging_Service_config

Conversation

@seantleonard
Copy link
Copy Markdown
Contributor

Why make this change?

What is this change?

  • In instances of ilogger usage, removes interpolated strings and uses structured logging paradigm:
    • in the message parameter, names in curly brackets are names that can be filtered in a log view such as app insights/log analytics. The parameters after message are the variables which supply the values for the names in curly brackets.
_logger.LogDebug(
                   message: "{correlationId} Request authentication state: {requestAuthStatus}.",
                   HttpContextExtensions.GetLoggerCorrelationId(httpContext),
                   requestAuthStatus);

testing

Testing is manual via analyzing the console, no logic changes were made to the engine.

…es by using exception parameter in iLogger which captures and outputs exception stacktrace and message by design.
@abhishekkumams
Copy link
Copy Markdown
Contributor

There are some places in COnfigurationController.cs class where we Log some error without correlationId, Is there a seperate issue for updating it?

@seantleonard
Copy link
Copy Markdown
Contributor Author

There are some places in COnfigurationController.cs class where we Log some error without correlationId, Is there a seperate issue for updating it?

Updated in this pr since configurationcontroller.cs is in the service project. Thanks for bringing my attention to that.

@seantleonard seantleonard added this to the 0.9rc milestone Sep 6, 2023
@seantleonard seantleonard merged commit b5d2cb6 into main Sep 6, 2023
@seantleonard seantleonard deleted the dev/seantleonard/structuredLogging_Service_config branch September 6, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants