Make logging-scope handling consistent across the logging integrations

Abierto
#6,024 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
csharp

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

.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).
Lenguaje dominante
C#
Estrellas
775
Forks
262
Merge medio
1 d 16 h
PR fusionados (30 d)
118

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/sentry-dotnet

Todos los issues de getsentry/sentry-dotnet

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.