logger.LogError display fail in Console and Error in Debug Output window.

Amit 731 Reputation points


I am using default logger in ASP.NET Core application and use a below super simple line.

logger.LogError("Exception Occur");

Now when I am looking it's output in console. It is displaying log level as fail.


fail: ProjectName[0]

Exception Occur

But when I am looking it's output in Debug (VS output window). it is displaying it's log level as Error.


ProjectName: Error: Exception Occur

Any reason for this behavior in default logging in asp.net core.

A set of technologies in the .NET Framework for building web applications and XML web services.
4,393 questions
0 comments No comments
{count} votes

Accepted answer
  1. Zhi Lv - MSFT 32,106 Reputation points Microsoft Vendor

    Hi @Amit Rawat

    Any reason for this behavior in default logging in asp.net core.

    They are using two kind of logging providers: Console and Debug, so they will use different kind of package (Microsoft.Extensions.Logging.Console and Microsoft.Extensions.Logging.Debug) and formatter to display the logging.

    If you want to customize the logging format, refer to Console log formatting.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,


    0 comments No comments

0 additional answers

Sort by: Most helpful