This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<!-- NOTE: Leave this file here and keep it in sync with list in dir.props. --> | |
<!-- The command-line doesn't need it, but the IDE does. --> | |
<packageSources> | |
<clear/> | |
<add key="myget.org dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" /> | |
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | |
</packageSources> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomConsoleLogFormatterOptions | |
{ | |
public string ExtraCustomProperty { get; set; } | |
} | |
internal class CustomConsoleLogFormatterOptionsSetup : ConfigureFromConfigurationOptions<CustomConsoleLogFormatterOptions> | |
{ | |
public CustomConsoleLogFormatterOptionsSetup(ILoggerProviderConfiguration<CustomConsoleLogFormatter> | |
providerConfiguration) | |
: base(providerConfiguration.Configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ConsoleApp46 | |
{ | |
class Program | |
{ | |
public static async Task Main(string[] args) | |
{ | |
using var loggerFactory = LoggerFactory.Create(builder => | |
{ | |
builder | |
// current usage which is to be changed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.Abstractions; | |
using Microsoft.Extensions.Logging.Console; | |
using Microsoft.Extensions.Options; | |
using System; | |
using System.IO; | |
namespace ConsoleApp46 | |
{ | |
public class CustomFormatter : ConsoleFormatter, IDisposable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.Console; | |
using Microsoft.Extensions.Logging.EventSource; | |
using System; | |
using System.Diagnostics.Tracing; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp46 | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.EventSource; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.Tracing; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp46 | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.EventSource; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.Tracing; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp46 | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.EventSource; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.Tracing; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp46 | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.Logging.EventSource; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.Tracing; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApp46 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is a console log formatter? | |
What are the in-box console log formatters? | |
Simple | |
JSON | |
SystemD | |
Compact | |
How do register a new formatter? | |
How do I select which formatter to use (via both code and config)? | |
How do I author a new formatter? |
OlderNewer