English 中文(简体)
ILoggingBuilder - clear some providers?
原标题:

I have a Blazor server web app running on Azure app services. When my code starts, as suggested, I have the following:

if (builder.Environment.IsDevelopment())
{
    builder.Logging.ClearProviders();
    builder.Logging.AddJsonConsole();
    builder.Logging.AddDebug();
}

Now for production on an Azure app service, please correct me if I m wrong, as I change nothing it ll set up the following providers (assuming I don t make any calls) - is this correct?

  • Console
  • Debug
  • EventSource
  • EventLog (Windows only)

And that feeds them across with all the {name} key:values and scopes passed to be displayed as desired - correct?

Question: Where does the Console & Debug providers go in production on Azure app service? I believe the Console goes nowhere unless I turn app logging on (max 12 hours). Is that correct? And where does Debug go?

Question: When I turn on log to the stream in Azure and set it to verbose/debug, it ignores the configuration I set in the appsettings.json and is giving me debug level log output for namespaces I set to warning. Shouldn t appsettings.json stop those log statements from ever getting to Azure?

Question: Is the following the correct way to add in Application Insights?

if (useApplicationInsights)
{
    builder.Logging.AddApplicationInsights();
    builder.Services.AddApplicationInsightsTelemetry();
}
问题回答

暂无回答




相关问题
Azure application service is missing .css file content

I finally have my Blazor .Net 6 application working as an Azure app service. One last problem I can t figure out, I m missing css from my project s wwwroot folder. But the font-icons are all there. ...

How to authenticate and authorize in blazor

Edit: I Answerd myself on this post. Its updated. I authenticate users using the Windows Authenticate from Blazor. Now I want to authorize these users as well, I do this by having the users roll and ...

Blazor custom validation in child component

I have this component that goes into a form like <NumberWithNAAndAmberRanges2 @bind-BindNumber="LocVM.ChartDayStartMinute" NaName="Not Applicable" NaAllowed="true&...

ILoggingBuilder - clear some providers?

I have a Blazor server web app running on Azure app services. When my code starts, as suggested, I have the following: if (builder.Environment.IsDevelopment()) { builder.Logging.ClearProviders(); ...

Blazor Server App : Unable to unprotect the message.State

I am getting an Exception as above in my Blazor server application. Below is my Program.cs File builder.Services.AddAuthentication(AzureADB2CDefaults.BearerAuthenticationScheme) .AddOpenIdConnect(...

热门标签