Serilog.Sinks.YouTrack
Send log events to YouTrack.
Package Serilog.Sinks.YouTrack | Platforms .NET 4.5, .NET Standard 1.3
Getting started
Install the Serilog.Sinks.YouTrack package from NuGet:
Install-Package Serilog.Sinks.YouTrack
Enable & configure the sink through one of the LoggerSinkConfiguration.YouTrack extension methods:
var log = new LoggerConfiguration().WriteTo.
YouTrack(new Uri("https://issue.tracker"), "user", "changeit", "PROJECT").
CreateLogger();
To configure templating & issue types:
var log = new LoggerConfiguration().WriteTo.
YouTrack(new Uri("https://issue.tracker"), "user", "changeit",
c => c.
UseProject("PROJECT").
UseIssueType(e => e.Exception != null ? "Bug" : "Task").
// Set priority
UsePriority("Critical").
// Execute YouTrack command against created issue
OnIssueCreated((e, uri) => "Subsystem infrastructure").
FormatSummaryWith("{Timestamp:yyyy-MM-dd} [{Level}] {Message}").
FormatDescriptionWith("{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}")).
CreateLogger();
Note: issues are not created in batches as YouTrack Import REST API would require low-level update permissions on the reporting account.
Integration tests (against YouTrack) only run if youtrack-connection
environment variable is set (e.g. youtrack-connection=host=https://issue.tracker;login=user;password=changeit
).