-
Notifications
You must be signed in to change notification settings - Fork 68
Logging
Elvin (Tharindu) Thudugala edited this page Aug 3, 2022
·
1 revision
From Version 10.0.0 and above
You can set ILogger to monitor internal logs
For example, you can use DebugLoggerProvider by Microsoft.Extensions.Logging.Debug
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
...
.UseLocalNotification();
builder.Services.AddLogging(logging =>
{
logging.AddDebug();
});
return builder.Build();
}
}
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new NavigationPage(new MainPage());
LocalNotificationCenter.Logger = new DebugLoggerProvider().CreateLogger("LocalNotification.Sample");
}
}