Skip to content

fix(logging): reference Serilog.Sinks.File for the File sink - #2558

Merged
erwan-joly merged 1 commit into
masterfrom
fix/serilog-file-sink
Oct 27, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
fix/serilog-file-sink

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Startup threw FileNotFoundException: Could not load file or assembly 'Serilog.Sinks.File, Version=7.0.0.0' because the File sink was configured but no project referenced the sink package.

  • Serilog.Sinks.File 7.0.0 added to central package versions and referenced from NosCore.Core
  • logger.yml gets the daily rolling logs/noscore-.log File sink next to Console (*.log is already gitignored)

Testing

  • dotnet build NosCore.sln: 0 warnings, 0 errors
  • MasterServer starts and writes logs/noscore-20261027.log

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Logs are now written to both the console and daily log files, making them available beyond the current console session.
    • Log entries in files include date-and-time timestamps, and the files support shared access while being written.

logger.yml's File sink failed at startup with a FileNotFoundException because
no project referenced the sink assembly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between b787cdc and ae0d177.

Files selected for processing: 3
  • Directory.Packages.props
  • configuration/logger.yml
  • src/NosCore.Core/NosCore.Core.csproj

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The project adds the Serilog.Sinks.File package and configures Serilog to write logs to a daily rolling file alongside the existing Console sink.

Changes

File logging

Layer / File(s) Summary
File sink dependency and configuration
Directory.Packages.props, src/NosCore.Core/NosCore.Core.csproj, configuration/logger.yml
The project references Serilog.Sinks.File version 7.0.0. The logger configuration adds a shared file sink at logs/noscore-.log with daily rolling and a date-and-time output template.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to ae0d1

The file logging setup is ready to merge based on the supplied evidence.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: adding a reference to Serilog.Sinks.File so the configured File sink loads at startup. The changeset adds the central package version, the NosCore.Core project reference, a…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: adding a reference to Serilog.Sinks.File so the configured File sink loads at startup. The changeset adds the central package version, the NosCore.Core project reference, and a File sink in logger.yml, which fits the title's fix for the startup FileNotFoundException. The title does not mention the new daily rolling log file, but it covers the primary fix. It uses the conventional commit format with a clear scope.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@erwan-joly
erwan-joly merged commit 71ea278 into master Oct 27, 2026
2 checks passed
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.

1 participant