question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI : LogMessage are not showing up anywhere

See original GitHub issue

Description

I am using Inject ILogger and writing log message, but i don’t see any output anywhere.

public ILogger<Index> _Logger { get; set; }

 protected override Task OnInitializedAsync()
{
    _Logger.LogInformation("Log Message from ILogger");
    System.Diagnostics.Debug.WriteLine("Log Message from Diganostic");
    Console.WriteLine("Log Message from console");
}

Is there something else to be configured in Blazor MAUI ?

Steps to Reproduce

  1. Create Blazor MAUI App
  2. In Index Page, after injecting the ILogger, inside OnInitializedAsync event
protected override Task OnInitializedAsync()
{
    _Logger.LogInformation("Log Message from ILogger");
    System.Diagnostics.Debug.WriteLine("Log Message from Diganostic");
    Console.WriteLine("Log Message from console");
}

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Android emulator

Did you find any workaround?

No

Relevant log output

None

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
nssidhucommented, Jun 7, 2022

@nssidhu thanks for contacting us.

Are you configuring a logging provider? Unlike asp.net core or blazor webassembly, I don’t believe .NET Maui apps register a default ILoggerProvider implementation.

No I am not doing anything extra when compared to Blazor Wasm. Any links to documents which tell about how to configure it ?

0reactions
Eiloncommented, Jun 20, 2022

PR to call AddDebug() in the project template: https://github.com/dotnet/maui/pull/8180

Read more comments on GitHub >

github_iconTop Results From Across the Web

Client-Side Logging in .NET MAUI with MetroLog.Maui
As a cherry on the cake we get the "Shake to display logs" ... in my free time, and not officially affiliated with...
Read more >
Troubleshoot known issues - .NET MAUI
Learn about .NET MAUI known issues and troubleshooting you can do to resolve these issues.
Read more >
Untitled
NET MAUI to show logs from native code WebMay 8, 2023 · Sands of MAUI: Issue ... in english MAUI : LogMessage are...
Read more >
Why cell phone service is down in Maui
It could take days or even weeks to get the networks back up and running. “911 is down. Cell service is down. Phone...
Read more >
Maui Undertakes Its Own Wildfire Relief Efforts: 'We're Not ...
Maui Undertakes Its Own Wildfire Relief Efforts: 'We're Not Going Anywhere'. Our reporter spent days on the island. Here's what she saw.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found