I have a .NET Core API project (Core 2.2) like this
namespace TestApplication2
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
ILoggerFactory loggerFactory = new LoggerFactory()
.AddConsole()
.AddDebug();
ILogger logger = loggerFactory.CreateLogger<Program>();
logger.LogInformation(
"This is a test of the emergency broadcast system.");
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
}
}
Can anyone inform me where can I find the logging output? In VS output tab I can see nothing.
In here
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1
it mentions something about console but I run the app from VS2017
.AddTrace()if you want to see it in Visual Studio console. - Rosdi Kasim