Show console output while debugging
When I debug my applications in Visual studio I can see all my log entries that are written to the console in the output window.
This is not the case in the current Rider version.
Can I activate this somehow or is this feature missing?
Please sign in to leave a comment.
Just click on the Console Tab inside the Debug Tab, there is what you are looking for......
@Thomas Bednarz: Untrue! See attached screenshots.

@Christian Müller: First of all: you should not blame people who try to help not telling the truth, thats rude!
The output of your Visual Studio with date, time, LogLevel and threadid etc. looks more like the output from a ConsoleAppender e.g. from Log4Net. Thats not the same as Console.WriteLine(). You did not say anything about your libraries, OS and target framework, etc. E.g. .NET core has lots of limitations and many libraries do not support 100% of the functionality available for Windoze. Log4Net is one of these libraries.
Rider is multi-platform it runs on the JVM. If you like to have full exclusive Windows support with a lot of excellent add-ons, use VisualStudio and Re-Sharper.
What I posted is a screenshot of my Rider Version 2017.3.1 on a CentOS 7 workstation. The project is a .NetCore 2.0 console application running in Debug mode.
The source of the output is:
#region RabbitMQ vHosts
Console.WriteLine("\nvHost operations");
Console.WriteLine("================\n");
Console.WriteLine("Deleting all TEST vHosts:");
foreach (var vhost in rabbitMgr.GetVHosts())
{
if (!vhost.Name.StartsWith("Test", StringComparison.OrdinalIgnoreCase)) continue;
Console.Write($"Deleting vHost {vhost.Name} ...");
rabbitMgr.DeleteVirtualHost(vhost);
Console.WriteLine("done.");
}
And as you can see, it is show in the debug output!
@Thomas Bednarz
I am sorry if that sounded rude. It wasn't meant to. On the contrary: I appreciate that you are trying to help me.
The point is: You claim to know what I am looking for but that is just not true. However, I am responsible for not making that clear, point taken.
So let's try that again:
I do see simple Console.WriteLines. The problem in my specific case is that there is a logger (NLog) that has a console appender registered in order to log to the console. As you can see in the screenshots, this output is written by VS but isn't written by rider.
I did use VS an R# prior to Rider and I switched to Rider since it is a lot faster. I'd love to continue using VS and R# but this is just not an option in my current project.
OK I am currently working on porting many of my servers from Windows (VisualStudio 2017 with Re-Sharper and .NET framework 4.x) to Linux more exactly to Docker (using .NETCore 2.x framework). I develop my servers on CentOS7 using the latest version of Rider. I have learned the following:
I switched to https://serilog.net/ which has other advantages compared with "traditional" and aged Log4Net. Using this logging framework is straight forward on .NETcore.
The feature you are looking for is supported out of the box, while it did not work with Log4Net. Here is a screenshot of the debugging console which shows all entries I wrote to the log:
Serilog has the concept of "Sinks" which is similar to the "Appenders" e.g. in Log4Net but probably more flexible. So what is seen above is the output from the Console Sink. There are tons of different sinks which can be configured and used. This is the whole configuration for Serilog in a .NET core application:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.Enrich.FromLogContext()
.Enrich.WithThreadId()
.Enrich.WithExceptionDetails()
.WriteTo.Console(outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] " +
"[ThreadId {ThreadId}] {Message:lj}{NewLine}{Exception}")
.WriteTo.File(Path.Combine(logDir, $"{LsConstants.ProductName}-.log"), rollingInterval: RollingInterval.Day,
outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{SourceContext}] " +
"[ThreadId {ThreadId}] {Message:lj}{NewLine}{Exception}")
.WriteTo.File(new CompactJsonFormatter(), Path.Combine(logDir, $"{LsConstants.ProductName}-JSON-.log"), rollingInterval: RollingInterval.Day)
.CreateLogger();
The last WriteTo writes the entire log as JSON which can be very useful for certain scenarios. For me, Serilog is the one and only logging library for .NET (core).
So final answer to your question: YES it is possible with Rider but it depends on the Logging framework. With a correctly configured Serilog sink it works!