Serilog.Sinks.MSBuild 1.2.1

This package provides a Serilog sink that redirects events to MSBuild.

It is useful when an MSBuild task calls code that uses Serilog.

Install-Package Serilog.Sinks.MSBuild -Version 1.2.1
dotnet add package Serilog.Sinks.MSBuild --version 1.2.1
<PackageReference Include="Serilog.Sinks.MSBuild" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Serilog.Sinks.MSBuild --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

A Serilog sink for MSBuild

License: Apache License 2.0
Nuget package: Serilog.Sinks.MSBuild

How to use

using Microsoft.Build.Utilities;
using Serilog;

public class MyTask: Task {

    public override bool Execute() {
        using (ILogger _logger = new LoggerConfiguration().WriteTo.MSBuild(this).CreateLogger()) {
            _logger.Information("Hello from my custom Serilog-powered task");
            // [...]
            return true;
        };
    }
}

Important properties

Some Serilog properties are important for this sink, as carry significant information for MSBuild.

They are covered in Serilog.Sinks.MSBuild.MSBuildMessages.

Maintainer(s)

A Serilog sink for MSBuild

License: Apache License 2.0
Nuget package: Serilog.Sinks.MSBuild

How to use

using Microsoft.Build.Utilities;
using Serilog;

public class MyTask: Task {

    public override bool Execute() {
        using (ILogger _logger = new LoggerConfiguration().WriteTo.MSBuild(this).CreateLogger()) {
            _logger.Information("Hello from my custom Serilog-powered task");
            // [...]
            return true;
        };
    }
}

Important properties

Some Serilog properties are important for this sink, as carry significant information for MSBuild.

They are covered in Serilog.Sinks.MSBuild.MSBuildMessages.

Maintainer(s)

Release Notes

Allow the specification of the message subcategory.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.1 66 8/10/2019
1.2.0 104 7/15/2019
1.1.1 45 7/6/2019
1.1.0 67 7/5/2019
1.0.0 47 7/4/2019