Skip to content

serilog-contrib/serilog-sinks-rollbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serilog.Sinks.RollbarCom

Build status Quality Gate NuGet

A Serilog sink which writes events to Rollbar.

Installation

The library is available as a Nuget package.

Install-Package Serilog.Sinks.RollbarCom

Get started

var log = new LoggerConfiguration()
    .WriteTo.Rollbar("Post server access token")
    .Enrich.FromLogContext()
    .CreateLogger();

// By default, only messages with level errors and higher are captured
log.Error("This error goes to Rollbar.");

Providing additional info

Person info

Rollbar docs person tracking

.WriteTo.Rollbar("Post server access token", transform: payload => {
    payload.Data.Person = new Person() {
        Id = myId,
        UserName = myUsername
    };
})

Code version

Rollbar docs versions

.WriteTo.Rollbar("Post server access token", transform: payload => {
    payload.Data.CodeVersion = myVersion;
})