Is there a way to format the output format in .NET Core logging?

Update: Since .NET 5 this can be customized as shown by other answers: Console log formatter documentation

Original Answer:

At the moment, this not configurable. The source code is here on GitHub:

logBuilder.Append(logName);
logBuilder.Append("[");
logBuilder.Append(eventId);
logBuilder.AppendLine("]");

If you want that, you need to write your own logger. However you can just copy the source code of the console logger, modify as needed and change the namespaces so it doesn’t interfere with the version Microsoft ships.

You can also open an issue on the logging repo to ask for this option.

Leave a Comment

techhipbettruvabetnorabahisbahis forumueduedusedueduseduedusedusedueduedus