Gasconade 1.2.0

A log message management system and exploration UI, in a similar vein to Swagger. Contains an expressive templating system.

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

Gasconade

<img src="https://github.com/i-e-b/gasconade/raw/master/icon.png"/>
https://www.nuget.org/packages/Gasconade

A self-documenting logging system for .Net -- like Swagger (UI) for logs.

Concepts

Configuring:

public class MyListenerClass: ILogListener { . . . }
. . .
Log.AddListener(new MyListenerClass());

Calling:

Log.Warning(new FailedToSend{Client="WhizbangSvc", Reason="it was rejected by client"});

Message Setup:

// This is the structure of the message, with replacement blocks:
[LogMessageTemplate("Could not send message to {Client} because {Reason}")]
// This text explains why the message would be logged, and what to do about it -- to be used by an Operations team:
[LogMessageDescription("A message was to be sent to a 3rd party client, but a non-network error occured.",
                       Causes = "Sent as a warning if it is not customer-impacting, as an error otherwise.",
                       Actions = "Check configuration matches accounts if one client gets repeated errors.")]
public class FailedToSend : TemplatedLogMessage {
    [LogParam("The 3rd party we were trying to send to")]
    public string Client {get;set;}

    [LogParam("Human-readable reason the message failed")]
    public string Reason {get;set;}
}

Sample Result:

Could not send message to WhizbangSvc because it was rejected by client

Gasconade UI

Aspnet Core MVC

Add to application configuration like:

app.UseMvc();
app.UseGasconadeUI(config => {
    config.AddAssembly(typeof(AnyMessageInTheProject).Assembly);
});

.Net Framework MVC WebApi

Add in global config like:

protected void Application_Start() {
    . . .
    GlobalConfiguration.Configure(MyGasconadeConfig.Register);
}

And a class like:

public class GasconadeConfig {
    public static void Register(HttpConfiguration config) {
        config.EnableGasconadeUi();
    }
}

Accessing the UI

If the setup is correct, there should be a route at http(s)://. . ./gasconade that exposes the UI.
You can add a link from your SwaggerUI like this:

config.EnableSwagger(c => {
            c.SingleApiVersion("v1", "SampleWebApi")
             .Description("A sample web application.<br/>For logging details, see " + GasconadeUi.Link("here"));
        })
    .EnableSwaggerUi(c => {
            c.DocumentTitle("My Swagger UI");
        });

If your message definitions are in a different assembly, you can add them like this:

config.EnableGasconadeUi(c =>
    {
        c.AddAssembly(typeof(AnyMessageInTheProject).Assembly);
    });

You can add a link back to Swagger UI like this:

config.EnableGasconadeUi(c =>
    {
        . . .
        c.AddSwaggerLink();
    });

Gasconade

<img src="https://github.com/i-e-b/gasconade/raw/master/icon.png"/>
https://www.nuget.org/packages/Gasconade

A self-documenting logging system for .Net -- like Swagger (UI) for logs.

Concepts

Configuring:

public class MyListenerClass: ILogListener { . . . }
. . .
Log.AddListener(new MyListenerClass());

Calling:

Log.Warning(new FailedToSend{Client="WhizbangSvc", Reason="it was rejected by client"});

Message Setup:

// This is the structure of the message, with replacement blocks:
[LogMessageTemplate("Could not send message to {Client} because {Reason}")]
// This text explains why the message would be logged, and what to do about it -- to be used by an Operations team:
[LogMessageDescription("A message was to be sent to a 3rd party client, but a non-network error occured.",
                       Causes = "Sent as a warning if it is not customer-impacting, as an error otherwise.",
                       Actions = "Check configuration matches accounts if one client gets repeated errors.")]
public class FailedToSend : TemplatedLogMessage {
    [LogParam("The 3rd party we were trying to send to")]
    public string Client {get;set;}

    [LogParam("Human-readable reason the message failed")]
    public string Reason {get;set;}
}

Sample Result:

Could not send message to WhizbangSvc because it was rejected by client

Gasconade UI

Aspnet Core MVC

Add to application configuration like:

app.UseMvc();
app.UseGasconadeUI(config => {
    config.AddAssembly(typeof(AnyMessageInTheProject).Assembly);
});

.Net Framework MVC WebApi

Add in global config like:

protected void Application_Start() {
    . . .
    GlobalConfiguration.Configure(MyGasconadeConfig.Register);
}

And a class like:

public class GasconadeConfig {
    public static void Register(HttpConfiguration config) {
        config.EnableGasconadeUi();
    }
}

Accessing the UI

If the setup is correct, there should be a route at http(s)://. . ./gasconade that exposes the UI.
You can add a link from your SwaggerUI like this:

config.EnableSwagger(c => {
            c.SingleApiVersion("v1", "SampleWebApi")
             .Description("A sample web application.<br/>For logging details, see " + GasconadeUi.Link("here"));
        })
    .EnableSwaggerUi(c => {
            c.DocumentTitle("My Swagger UI");
        });

If your message definitions are in a different assembly, you can add them like this:

config.EnableGasconadeUi(c =>
    {
        c.AddAssembly(typeof(AnyMessageInTheProject).Assembly);
    });

You can add a link back to Swagger UI like this:

config.EnableGasconadeUi(c =>
    {
        . . .
        c.AddSwaggerLink();
    });

Release Notes

Ability to clear listeners

    • Tag (>= 1.1.0)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.2.0 492 8/20/2018
1.1.2 564 4/17/2018
1.0.0 281 3/13/2018