Skip to content

Update NetCore2 ConsoleExample to include the minimumlevel.#167

Merged
304NotModified merged 1 commit into
NLog:masterfrom
seblucas:master
Nov 1, 2017
Merged

Update NetCore2 ConsoleExample to include the minimumlevel.#167
304NotModified merged 1 commit into
NLog:masterfrom
seblucas:master

Conversation

@seblucas
Copy link
Copy Markdown
Contributor

@seblucas seblucas commented Nov 1, 2017

Also add a mandatory dep

Related to #166 and #143

@304NotModified
Copy link
Copy Markdown
Member

Thanks!

@304NotModified 304NotModified merged commit ffee282 into NLog:master Nov 1, 2017

services.AddSingleton<ILoggerFactory, LoggerFactory>();
services.AddSingleton(typeof(ILogger<>), typeof(Logger<>));
services.AddLogging((builder) => builder.SetMinimumLevel(LogLevel.Trace));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @304NotModified ,

Why do we have to call SetMinimumLevel(Loglevel.Trace) to configure the microsoft log level? Why doesnt it just utilize the configuration in our nlog.config?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question. That's indeed better if this step isn't needed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants