How to get console output in ASP.NET Core using IIS Express

The documentation in ASP.Net Core here has good console log output, as in the image below, with colors for various LogLevels. Now I created the application in Visual Studio, and I see that it now works for IIS Express, and I no longer see the console. I remember that when I launched the beta, it popped up immediately with Kestrel with this good console output.

Can I get this beautiful window now?

PS It’s a little strange that the documentation still contains these images that you don’t even see.

enter image description here

+5
source share
1 answer

Yes, this is possible using IIS Express. Use the Microsoft.Extensions.Logging.Debug nuget package: https://github.com/aspnet/Logging/tree/master/src/Microsoft.Extensions.Logging.Debug . Configure the registrar in Startup.cs:

loggerFactory.MinimumLevel = LogLevel.Debug; loggerFactory.AddDebug( LogLevel.Debug ); var logger = loggerFactory.CreateLogger("Startup"); logger.LogWarning("Logger configured!"); 

and

 Console.WriteLine("Hi!"); 
+4
source

Source: https://habr.com/ru/post/1258518/


All Articles