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

Collect all Setup Logs in single file and add Configuration diagnostic logs #201

Merged
merged 5 commits into from
Apr 12, 2023
Merged

Collect all Setup Logs in single file and add Configuration diagnostic logs #201

merged 5 commits into from
Apr 12, 2023

Conversation

florelis
Copy link
Member

Summary of the pull request

This changes the Setup Flow logs to create a single file, instead of multiple for each component - except that the elevated process still logs to its own file, but it is now in the same folder.
It also standardizes the component strings used for prefixing the log messages, and wires the Configuration diagnostic messages to write to the same log files.

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated
Not Found
@@ -69,14 +73,36 @@ public async Task ApplyConfigurationAsync()
throw new InvalidOperationException();
}

_logger.ReportInfo("Starting to apply configuration set");
Log.Logger?.ReportInfo(Log.Component.Configuration, "Starting to apply configuration set");
_result = await _processor.ApplySetAsync(_configSet, ApplyConfigurationSetFlags.None);
Copy link
Contributor

@dhoehna dhoehna Apr 12, 2023

Choose a reason for hiding this comment

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

Would this crash if you called ApplySetAsync at the top of the function then awaited the task later in the method? A lot of this code uses member variables and I don't know if calling functions out of order would throw something off.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it probably would. Changed to have this return an object with the result, instead of relying on accessing the other properties after the await. The only remaining dependency regarding order is that the Open method must be awaited before calling the Apply one.

{
switch (diagnosticInformation.Level)
{
case DiagnosticLevel.Verbose:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have a default just in case the enum is updated and the change wasn't reflected here?

Copy link
Contributor

@dhoehna dhoehna left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@florelis
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

_processor = new ConfigurationProcessor(factory);
factory.MinimumLevel = DiagnosticLevel.Verbose;
Copy link
Contributor

@AmelBawa-msft AmelBawa-msft Apr 12, 2023

Choose a reason for hiding this comment

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

Duplicate factory.MinimumLevel = DiagnosticLevel.Verbose;

Thanks for adding the Diagnostics logs here 🥳

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. It should have been Processor.

@florelis
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@florelis florelis merged commit 9faebf5 into microsoft:main Apr 12, 2023
@florelis florelis deleted the configLogs branch April 12, 2023 23:36
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.

None yet

3 participants