Dot.Inscribe 1.0.1

dotnet add package Dot.Inscribe --version 1.0.1
                    
NuGet\Install-Package Dot.Inscribe -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dot.Inscribe" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dot.Inscribe" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Dot.Inscribe" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dot.Inscribe --version 1.0.1
                    
#r "nuget: Dot.Inscribe, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Dot.Inscribe@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Dot.Inscribe&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Dot.Inscribe&version=1.0.1
                    
Install as a Cake Tool

Dot.Inscribe

Make Serilog setup in ASP.NET Core painless. One fluent builder, sensible defaults, rich HTTP request logging, and useful enrichers — ready for production in minutes.

  • Works with .NET 9
  • Sinks: Console, File, SQL Server, optional Splunk HEC
  • Enrichers: CorrelationId, Activity (TraceId/SpanId), HttpContext basics, Machine/Thread
  • Request logging: message template, header redaction, optional body capture, level overrides

Install

  • NuGet (when published): dotnet add package Dot.Inscribe
  • Until then: add a project reference to Dot.Inscribe

60‑second Quickstart

Program.cs (minimal hosting):

var builder = WebApplication.CreateBuilder(args);

var inscribe = builder.Services
    .AddDotInscribe()
    .WriteToConsole()
    .WriteToFile(o => o.Path("logs/app-.log").RollingDaily().Retain(7))
    .EnrichWithCorrelation()
    .EnrichWithHttpContext()
    .EnrichWithMachineAndThread()
    .MinimumLevelInformation();

inscribe.Build(builder.Configuration);

var app = builder.Build();

app.UseDotInscribeRequestLogging(); // basic HTTP request logging

app.MapGet("/", () => "OK");
app.Run();

Common recipes

  • Console sink
    .WriteToConsole()
    
  • File sink
    .WriteToFile(o => o.Path("logs/app-.log").RollingDaily().Retain(7))
    
  • SQL Server sink
    // Minimal
    inscribe.WriteToSqlServer(o => o
        .Connection(builder.Configuration.GetConnectionString("Logs")!)
        .Schema("dbo").Table("Logs").AutoCreateTable()
    );
    
    // Control SQL table columns (parametrable)
    inscribe.WriteToSqlServer(o => o
        .Connection(builder.Configuration.GetConnectionString("Logs")!)
        .Schema("dbo").Table("HttpLogs").AutoCreateTable()
        .Columns(c => c
            // Enable/disable standard columns
            .UseStandard(
                level: true,
                message: true,
                timestamp: true,
                exception: false,       // don't store exception text
                properties: false,      // don't store JSON Properties
                messageTemplate: true,  // keep message template
                logEvent: false         // keep full LogEvent off (large)
            )
            // Add custom varchar columns
            .AddVarchar("RequestPath", 256)
            .AddVarchar("ClientIp", 64)
        )
    );
    
    Notes:
    • Standard columns you can toggle: Level, Message, TimeStamp, Exception, Properties, MessageTemplate, LogEvent.
    • Defaults mirror Serilog's MSSqlServer sink (LogEvent is off by default).
    • AutoCreateTable() will create the table with the chosen columns on first run.
  • Splunk HEC (requires Serilog.Sinks.Splunk in your app)
    inscribe.WriteToSplunkHec(o =>
    {
        o.Host = "https://splunk:8088/services/collector";
        o.Token = "<hec-token>";
    });
    

Request logging (options)

Keep it simple, or add options as needed:

app.UseDotInscribeRequestLogging(o => o
    .MessageTemplate("HTTP {RequestMethod} {RequestPath} -> {StatusCode}")
    .RedactHeaders("Authorization", "Cookie")
    .IncludeRequestBody(1024)              // optional: bytes
    .IncludeResponseBody(1024)             // optional: bytes
);

Tip: body capture costs CPU/memory — keep limits small in production.

Advanced: you can also call the lower-level

app.UseDotRequestLogging(o => { /* same options */ });

Enrichers

.EnrichWithCorrelation()    // CorrelationId from header or TraceIdentifier
.EnrichWithSpan()           // TraceId, SpanId (Activity)
.EnrichWithHttpContext()    // Method, Path, ClientIp
.EnrichWithMachineAndThread()

Notes & compatibility

  • Uses Serilog 4.x and Serilog.AspNetCore 8.x.
  • The builder wires Serilog into Microsoft.Extensions.Logging. Use ILogger<T> anywhere in your app.
  • appsettings.json: this builder doesn’t auto-bind Serilog settings; configure via the fluent API shown above.

Troubleshooting

  • No logs? Ensure inscribe.Build(...) is called before builder.Build() and at least one sink is configured.
  • Splunk not logging? Add a reference to Serilog.Sinks.Splunk in your app.
  • SQL issues? Check connection string and that AutoCreateTable() is enabled initially.

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 90 8/15/2025
1.0.0 94 8/15/2025