Skip to content

Documentation: Missing examples for ASP.NET Core integration #14

@hokagedami

Description

@hokagedami

Documentation Issue

The current README doesn't have examples for ASP.NET Core integration, which is probably the most common use case.

What's Missing

  • How to register in Program.cs with dependency injection
  • Configuration with appsettings.json
  • Integration with ASP.NET Core's built-in logging
  • Performance considerations for web applications

Proposed Sections

Basic Integration

// Program.cs
builder.Services.AddLogging(loggingBuilder =>
    loggingBuilder.AddSerilog(new LoggerConfiguration()
        .Enrich.WithCallStack()
        .WriteTo.Console()
        .CreateLogger()));

Configuration

{
  "Serilog": {
    "Using": ["Serilog.Enrichers.CallStack"],
    "Enrich": ["WithCallStack"]
  }
}

Controller Usage

Examples showing how the enricher works with controller actions, middleware, and exception handling.

This would help adoption significantly. I can submit a PR with these examples if needed!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions