Skip to content

Serilog for Dotnet Aspire #359

@BartNetJS

Description

@BartNetJS

I'm exploring the new Dotnet 8 Aspire dashboard.
Out of the box it is providing structured logs (from opentelemetry) and tracing as shown in the print screen:
image

As soon i add Serilog Use like this

builder.Host.UseSerilog();

I loose the structured logs.
For example here i added the UseSerilog in the web frontend:
image

The serilog instrumentation is like this:

Log.Logger = new LoggerConfiguration() .WriteTo.Console() .Enrich.FromLogContext() .Enrich.With(new TraceIdEnricher()) .CreateLogger();

How can i use Serilog and Aspire together?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions