Skip to content

Instantly share code, notes, and snippets.

@blachniet
Created July 19, 2014 01:33
Show Gist options
  • Select an option

  • Save blachniet/79c5b604dd457260257f to your computer and use it in GitHub Desktop.

Select an option

Save blachniet/79c5b604dd457260257f to your computer and use it in GitHub Desktop.
Creates 2 top-level loggers, loggerA and loggerB using different configurations.
using System;
using Serilog;
public class Program
{
public static void Main()
{
var loggerA = new LoggerConfiguration().WriteTo.Console().CreateLogger();
loggerA.Information("Logging to top-level loggerA");
var loggerB = new LoggerConfiguration().WriteTo.ColoredConsole().CreateLogger();
loggerB.Information("Logging to top-level loggerB");
Console.WriteLine("Hello World");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment