Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging issue on .netcore applications #170

Open
Diggzinc opened this issue Jan 8, 2021 · 2 comments
Open

Logging issue on .netcore applications #170

Diggzinc opened this issue Jan 8, 2021 · 2 comments

Comments

@Diggzinc
Copy link
Contributor

Diggzinc commented Jan 8, 2021

Problem

Logs don't work under .netcore regarding of the configuration used.

Detailed Explanation

Doesn't matter how much I change the configuration for the logger based on the Microsoft documentation, be it through the appsettings.json or through environment variables, I can never get the logger to output the issued commands to the System.Diagnostics.Trace.Listeners.

After digging through the source code, I've found that for .netcore applications the code logs using the Trace log level as shown on the following line.

InternalLogger.Value.LogTrace(message);

But then the provided provider is injected with the use of the .AddDebug() extension method which by default uses a minimum log level of Information.

Due to this, for .netcore all the logs are dropped due to the filter, I've compiled it myself and changed the LogLevel to Trace and was then able to get the logs on the Listeners as expected.

Possible Solution

Change the LogLevel filter on the Logger component.

Why this is a problem (for me)

Currently, one of my build machines is printing the docker-compose up help documentation as an error instead of creating the stack. I want to be able to see what is the command that is being issued in order to see what is the problem.

Any input would be appreciated.
Thanks in advance 😄

@mariotoffia
Copy link
Owner

Hi and thanks! :) - can you do a PR on this issue?

@Diggzinc
Copy link
Contributor Author

Yes, I'll sort it out this weekend :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants