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

log with LogDebug level are never printed in console. #7

Closed
dsaurel opened this issue Jun 17, 2018 · 2 comments
Closed

log with LogDebug level are never printed in console. #7

dsaurel opened this issue Jun 17, 2018 · 2 comments
Assignees

Comments

@dsaurel
Copy link

dsaurel commented Jun 17, 2018

Hi, i'm using you nuget package with Blazor 0.4. I've encountered a strange behaviour.

In Program.cs,
// Add Blazor.Extensions.Logging.BrowserConsoleLogger services.AddLogging(builder => builder .AddBrowserConsole() // Register the logger with the ILoggerBuilder .SetMinimumLevel(LogLevel.Trace) // Set the minimum log level to Information );

Then i injected logger in an hypothetical BlazorComponent:
[Inject] private ILogger<IndexComponent> _logger { get; set; }

Somewhere in a click triggered method:

_logger.LogDebug($"LogDebug {this.GetType().FullName}");
_logger.LogInformation($"LogInformation {this.GetType().FullName}");
_logger.LogWarning($"LogWarning {this.GetType().FullName}");
 _logger.LogTrace($"LogTrace {this.GetType().FullName}");
 _logger.LogCritical($"LogCritical {this.GetType().FullName}");

The message associated with logger.LogDebug is never printed in browser console.

Tested on Chrome Windows Version 67.0.3396.87 (Build officiel) (64 bits)

Thanks.

@attilah
Copy link
Member

attilah commented Jun 18, 2018

Hi @dsaurel!

This is not an issue with the logger, if you check in Edge or Firefox it just works.

The reason why you are not seeing it in Chrome is that from Chromium 58 the output of this method only appears when level Verbose is selected in the DevTools.

image

After enabling it you see the expected output:

image

@attilah attilah closed this as completed Jun 18, 2018
@dsaurel
Copy link
Author

dsaurel commented Jun 18, 2018

Thanks 👍

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