1
submitted 10 months ago* (last edited 10 months ago) by SmartmanApps@programming.dev to c/dotnetmaui@programming.dev

I'm just trying out the built-in builder.Logging.AddDebug(); in a MAUI app, but don't see the output anywhere. From several blogs I expected to see the messages in the Visual Studio Debug output window, but they aren't appearing.

Just using the stock-standard MAUI app, the only changes I have made are in App.cs as follows...

using Microsoft.Extensions.Logging;
using Microsoft.Maui.Controls;
namespace BaseMAUIApp;
internal class App :Application
{
public App(ILogger<App> logger) {
    logger.LogDebug("******************* Message from logger!");
// rest of code...

But I don't see my message anywhere. Is there something else I have to configure, or somewhere else I have to look?

top 1 comments
sorted by: hot top controversial new old
[-] SmartmanApps@programming.dev 1 points 10 months ago

I got the solution from someone on Mastodon. Add the following line to MauiProgram.cs and it works...

builder.Logging.SetMinimumLevel(LogLevel.Debug);
this post was submitted on 11 Jan 2024
1 points (66.7% liked)

.NET MAUI

119 readers
1 users here now

founded 11 months ago
MODERATORS