Make logging-scope handling consistent across the logging integrations

オープン
#6,024 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
csharp

調査の方向性

Read linked issues #5635, #5222, #3081, and #4882 to understand the behavior and decisions already in play. The issue asks for consistent scope handling across MEL, Serilog, structured logs, and documentation, but leaves the shared behavior undecided. Start by resolving the listed decisions with maintainers; done means the integrations and docs follow an agreed behavior.

索引モデルが issue の本文から書いたものです。

説明

.NET Logs Microsoft.Extensions.Logging Serilog State: Needs Discussion Tracking Issue

Each logging integration turns logging-scope state (ILogger.BeginScope in Microsoft.Extensions.Logging, LogContext in Serilog) into Sentry data in its own way. Structured logs don't use it at all yet, and the docs don't explain it.

Area Issue Status
MEL and Serilog behave differently #5635 Different value handling, read at different times, different opt-outs, and different behaviour in global mode.
BeginScope state on structured logs #5222 Not implemented. The plan from 2026-10-20 is an opt-in IncludeScopes option on SentryLoggingOptions, off by default because ASP.NET Core opens a logging scope for every request.
Docs for passing data with BeginScope #3081 The MEL guide mentions BeginScope only under tag filters. Best written once the behaviour above settles.

Decisions to make once, for every integration

  • Which values to keep: MEL keeps only string values, while Serilog calls ToString() on every property.
  • When to read them: MEL copies them into the Sentry scope when BeginScope is called, while Serilog reads LogContext each time an event is captured.
  • How to opt out: MEL has the public SentryOptions.SentryScopeStateProcessor, while Serilog's processor is internal.
  • Global mode (MAUI, desktop): MEL's PushScope does nothing there, but the Serilog processor still runs.
  • Precedence: where logger-scope attributes sit relative to attributes on the Sentry scope (#4882).
主要言語
C#
スター
775
フォーク
262
平均マージ
1日 16時間
マージ済み PR(30日)
118

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

getsentry/sentry-dotnet のほかの issue

getsentry/sentry-dotnet の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。