A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/billpratt/serilog-sinks-sumologic below:

billpratt/serilog-sinks-sumologic: A Serilog event sink that writes to Sumo Logic

A Serilog sink that writes events to Sumo Logic.

Package - Serilog.Sinks.SumoLogic | Platforms - .NET 4.5, .NET Core, .NETStandard 1.5

// basic usage writes to Sumo Logic with the default source name 'Serilog'
var log = new LoggerConfiguration()
    .WriteTo.SumoLogic("[YOUR SUMO COLLECTOR URL]")
    .CreateLogger();

// override default Sumo Logic source name
var log = new LoggerConfiguration()
    .WriteTo.SumoLogic("[YOUR SUMO COLLECTOR URL]", "FancyPantsSourceName")
    .CreateLogger();
Install-Package Serilog.Extensions.Logging -DependencyVersion Highest
using Serilog;
using Serilog.Sinks.SumoLogic;

public class Startup
{
  public Startup(IHostingEnvironment env)
  {
    Log.Logger = new LoggerConfiguration()
      .WriteTo.SumoLogic("http://localhost")  //replace with your SumoLogic endpoint
      .CreateLogger();
      
    // Other startup code
public void Configure(IApplicationBuilder app,
                        IHostingEnvironment env,
                        ILoggerFactory loggerfactory,
                        IApplicationLifetime appLifetime)
  {
      loggerfactory.AddSerilog();
      
      // Ensure any buffered events are sent at shutdown
      appLifetime.ApplicationStopped.Register(Log.CloseAndFlush);

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4