Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

ConsoleLoggerOptions are not properly stored by ConsoleLoggerProvider #665

Closed
@analogrelay

Description

@analogrelay

As a result, Loggers are only updated with new settings when the options changes, and only the loggers already registered at the time the options are loaded are updated, new loggers get default settings.

This is because the constructor doesn't initialize _settings with the current value: https://github.com/aspnet/Logging/blob/dev/src/Microsoft.Extensions.Logging.Console/ConsoleLoggerProvider.cs#L39

Then when a logger is created, it uses the non-existent _settings which means it falls back to default behavior: https://github.com/aspnet/Logging/blob/dev/src/Microsoft.Extensions.Logging.Console/ConsoleLoggerProvider.cs#L105

/cc @davidfowl @pakrym

@Eilon @muratg This is necessary for RTM and a fairly trivial fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @analogrelay@pakrym@muratg

      Issue actions

        ConsoleLoggerOptions are not properly stored by ConsoleLoggerProvider · Issue #665 · aspnet/Logging