Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 962 Bytes

README.md

File metadata and controls

32 lines (22 loc) · 962 Bytes

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 carry meaningful information for MSBuild, like message code, file and line and column numbers.

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

Maintainer(s)