Skip to content

How to add logging to Grapevine #121

Answered by scottoffen
AgrYpn1a asked this question in Q&A
Discussion options

You must be logged in to vote

Unlike previous version, Grapevine doesn't have a custom logging implementation, relying instead on the Microsoft logging and dependency injection abstractions to provide loggers where needed. In this example, I'll use NLog, but Serilog can also be used.

If Unity's logger doesn't conform to the Microsoft abstraction, you'll need to write your own wrapper for it that does.

First, we create a startup class, and configure our logging:

public class Startup
{
    public IConfiguration Configuration { get; private set; }

    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public void ConfigureServices(IServiceCollection services)
    {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by scottoffen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants