In the ASP.NET Core 2.0, I use the default logging API. My app is hosted as an Azure Web App.
My question: Where are these outputted? And how do I modify it?
You need to add providers as mentioned later in https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?tabs=aspnetcore2x :
public static void Main(string[] args)
{
var webHost = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.ConfigureAppConfiguration((hostingContext, config) =>
{
var env = hostingContext.HostingEnvironment;
config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
config.AddEnvironmentVariables();
})
.ConfigureLogging((hostingContext, logging) =>
{
logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
logging.AddConsole();
logging.AddDebug();
})
.UseStartup()
.Build();
webHost.Run();
}
For azure you can use the Azure App Service provider (https://www.nuget.org/packages/Microsoft.Extensions.Logging.AzureAppServices)
logging.AddAzureWebAppDiagnostics();