Question: I'm trying to print a log message in ASP.NET Core this way: 

```
Console.WriteLine( "Hello World!" );

loggerFactory.MinimumLevel = LogLevel.Debug;
loggerFactory.AddConsole( LogLevel.Debug );
var logger = loggerFactory.CreateLogger("Startup");
logger.LogWarning( "Hi!" );

```

Where can I see this message?

The Output window doesn't contain this message.

If I run the project as Web, it runs the `dnx` console where I can see the message, but it is not convenient.

If I run project as IIS Express I don't see the console, or the message.

Is there way to view the message in Visual Studio?

Answer: 
You can use the [`Debug` listener](https://github.com/aspnet/Logging/tree/master/src/Microsoft.Extensions.Logging.Debug) to achieve what you want:

```
"dependencies": {
  "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final"
}

```

---

```
Console.WriteLine( "Hello World!" );

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

```
IIS Express will not output its logs to Visual Studio's output window. 

You'll need to use a different log provider. 

Write it to a log file. You can use a library for that, for example [Serilog](http://nblumhardt.com/2015/05/diagnostic-logging-in-dnx-asp-net-5/):

```
using Serilog;

public class Startup
{
  public Startup(IHostingEnvironment env)
  {
      Log.Logger = new LoggerConfiguration()
          .WriteTo.File("log.txt")
          .CreateLogger();
...
public void Configure(IApplicationBuilder app, IHostingEnvironment env,
                        ILoggerFactory loggerFactory)
  {
      loggerFactory.AddSerilog();

```

You'll need [this NuGet](https://www.nuget.org/packages/Serilog.Extensions.Logging/1.0.0-rc1-final-10092) package.