I am trying to implement logging in a .Net Core API and do not see the log file anywhere.
I'm using Microsoft.Extensions.Logging; and theILogger factory method.
In my Program.cs I have...
var host = new WebHostBuilder()
.UseApplicationInsights()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
In my Startup.cs I have this in the Configure method...
loggerFactory.AddApplicationInsights(app.ApplicationServices, LogLevel.Warning);
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
loggerFactory.AddEventSourceLogger();
In my appsettings.json I have this...
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
In my controller, I inject the logger and called the method this way...
_logger.LogError("ERROR_MESSAGE_STRING");
The LogError method is being called with the error string but I do not see the log. I would expect to see the log error file somewhere. In the bin directory maybe?