Skip to content

Add 'IncludeEventID' to 'SimpleConsoleFormatterOptions' #119238

@CoenraadS

Description

@CoenraadS

Background and motivation

The 'SimpleConsoleLogger' is not very simple, including EventID in each log message:

info: Program[0] Hello World

The desired result is:

info: Program Hello World

This is currently not configurable, see:

https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs#L98-L108

I would like to propose the following property be added to SimpleConsoleFormatterOptions

public bool IncludeEventID { get; set; } = true

By defaulting to true, there is no behaviour change to the current implementation.
Setting it to false would remove the event id from being included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions