Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostics to the processor component #3087

Merged
merged 5 commits into from
Mar 21, 2023

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Mar 18, 2023

Change

This change adds the same diagnostics event to the IConfigurationSetProcessorFactory as the ConfigurationProcessor already has. It also adds a property to control the minimum level of events, enabling filtering to be done at event publishing rather than consumption.

All of the public facing methods in the processor component are enlightened to send any escaping exceptions to the diagnostics before letting them generate an error. Additionally, verbose logs are added throughout to enable a better understanding of what/when things are happening.

Validation

Manual runs, including with verbose logging enabled. Verified output in log file.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner March 18, 2023 00:14
}
catch (Exception ex)
{
this.OnDiagnostics(DiagnosticLevel.Error, ex.ToString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know how much ToString outputs for a RuntimeException? If it doesn't include much from the ErrorRecord we should also log that. I found ScriptStackTrace to be really helpful.

https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.errorrecord?view=powershellsdk-7.3.0#properties

@github-actions

This comment has been minimized.

@JohnMcPMS JohnMcPMS merged commit 1898da0 into microsoft:master Mar 21, 2023
@JohnMcPMS JohnMcPMS deleted the config-logs branch March 21, 2023 00:15
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.

2 participants