Skip to content

Fix compiler server logging - #85193

Merged
jjonescz merged 2 commits into
dotnet:mainfrom
jjonescz:server-logging
Sep 11, 2026
Merged

Fix compiler server logging#85193
jjonescz merged 2 commits into
dotnet:mainfrom
jjonescz:server-logging

Conversation

@jjonescz

@jjonescz jjonescz commented Sep 7, 2026

Copy link
Copy Markdown
Member

Fixes a regression from #84701 - automatic compiler server logging to the file/directory specified by the env var RoslynCommandLineLogFile stopped working.

Microsoft Reviewers: Open in CodeFlow

@jjonescz
jjonescz requested review from jaredpar and a balanced review from Copilot September 7, 2026 15:54
@jjonescz
jjonescz requested a review from a team as a code owner September 7, 2026 15:54
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix restores the intended behavior and includes adequate regression coverage.

Pull request overview

Restores RoslynCommandLineLogFile handling for the compiler server while preserving explicit -log: precedence.

Changes:

  • Uses environment-based logging when no explicit log path is supplied.
  • Adds regression tests for file, directory, and override scenarios.
File summaries
File Description
VBCSCompiler.cs Restores environment-variable logging fallback.
VBCSCompilerServerTests.cs Tests logging paths and precedence.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

}

using var logger = new CompilerServerLogger($"VBCSCompiler {Process.GetCurrentProcess().Id}", options.LogFilePath);
using var logger = options.LogFilePath is null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: personally, I'd prefer inlining the ternary into the argument, rather than duplicating the entire constructor call, but up to you if you address this or won't fix.

@jjonescz jjonescz Sep 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Well, we can't inline since it needs to call a different overload, but I should at least share the other argument expression. Thanks.

Copilot AI review requested due to automatic review settings September 9, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix is correct and covers the relevant logging scenarios.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@jjonescz

Copy link
Copy Markdown
Member Author

@333fred for another look, thanks

@jjonescz
jjonescz requested a review from 333fred September 10, 2026 07:19
@jjonescz
jjonescz merged commit 0c14b7c into dotnet:main Sep 11, 2026
22 checks passed
@jjonescz
jjonescz deleted the server-logging branch September 11, 2026 08:54
@dotnet-policy-service dotnet-policy-service Bot added this to the Next milestone Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants