SplatDev.Logger 1.0.2

dotnet add package SplatDev.Logger --version 1.0.2
                    
NuGet\Install-Package SplatDev.Logger -Version 1.0.2
                    
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="SplatDev.Logger" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SplatDev.Logger" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SplatDev.Logger" />
                    
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 SplatDev.Logger --version 1.0.2
                    
#r "nuget: SplatDev.Logger, 1.0.2"
                    
#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 SplatDev.Logger@1.0.2
                    
#: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=SplatDev.Logger&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SplatDev.Logger&version=1.0.2
                    
Install as a Cake Tool

SplatDev.Logger

Lightweight, static-class, database-backed logger using Entity Framework Core with SQL Server. Fire-and-forget logging that never crashes the application — all exceptions are silently swallowed.

NuGet

Compatibility

.NET Package Version
8.0 1.0.0
10.0 1.0.0

Installation

dotnet add package SplatDev.Logger

What's implemented

Logging API

The static SplatDev.Logger.Logger class provides two overloads:

  • Log(string message, string details = "", LogType type = LogType.Info, string user = "System") — writes a log entry with message, optional details, severity, and user identifier.
  • Log(string message, Exception exception, LogType type = LogType.Error, string user = "System") — writes a log entry from an exception, capturing Message, StackTrace, and InnerException.Message in the Details column.

Each call creates a short-lived LoggerDbContext, inserts the entry, saves changes, and disposes. All exceptions are caught and discarded — logging failures never propagate.

Log entity

The Log entity maps to a SQL Server table:

Column Type Notes
Id int (PK, identity) Auto-increment
DateTime DateTime Log timestamp
LogType LogType enum Error, Info, or Warning
Message string Short summary
Details string Stack trace, inner exception, or free-form text
User string Who triggered the log entry

LogType enum

Value Display
LogType.Error "Error"
LogType.Info "Information"
LogType.Warning "Warning"

LoggerDbContext

A standard EF Core DbContext with DbSet<Log> Logs. Constructed with DbContextOptions<LoggerDbContext>. The static Logger creates instances internally using UseSqlServer(ConnectionString).

Configuration

Connection string

Set the static ConnectionString property before any logging calls:

SplatDev.Logger.Logger.ConnectionString = "Server=localhost;Database=MyDb;...";

This is typically done once at application startup.

Database table

Create the Logs table using EF Core migrations or raw SQL:

CREATE TABLE [Logs] (
    [Id]       INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [DateTime] DATETIME2         NOT NULL,
    [LogType]  INT               NOT NULL,
    [Message]  NVARCHAR(MAX)     NULL,
    [Details]  NVARCHAR(MAX)     NULL,
    [User]     NVARCHAR(450)     NULL
);

Appsettings

No appsettings keys are required. The package does not bind any options POCO. Connection string management is the consumer's responsibility — wire it from IConfiguration, environment variables, or a secrets manager:

var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
SplatDev.Logger.Logger.ConnectionString = connectionString;

Usage

using SplatDev.Logger;

// Info log
Logger.Log("User registered", details: "email=user@example.com");

// Warning log
Logger.Log("Rate limit approaching", type: LogType.Warning);

// Error log from exception
try
{
    // ... risky operation
}
catch (Exception ex)
{
    Logger.Log("Checkout failed", ex, type: LogType.Error, user: "customer@example.com");
}

Dependencies

Package Purpose
Microsoft.EntityFrameworkCore 8.0.13 EF Core ORM
Microsoft.EntityFrameworkCore.SqlServer 8.0.13 SQL Server provider

Caveats

  • No DI integration. Logger is a static class. It does not support ILogger<T> or structured logging. For ILogger-based logging, configure the standard ASP.NET Core logging pipeline instead.
  • Swallowed exceptions. All catch { } blocks silently discard logging failures. This guarantees logging never crashes the application, but it means database connection failures or schema mismatches go completely undetected. Monitor your Logs table periodically to confirm entries are being written.
  • Short-lived DbContext. Each Log() call creates and disposes its own DbContext. This is fine for low-to-moderate volume but may create connection pressure at scale. For high-throughput scenarios, consider a queued background writer.
  • No migration support. The package does not include EF Core migrations. You are responsible for creating the Logs table in your database.
  • DateTime.Now. Timestamps use server-local time, not UTC. If your servers span time zones, convert to UTC at query time.

SplatDev.Logger — part of the SplatDev.Umbraco.Plugins suite. Licensed under MIT. © SplatDev Ltda.

Changelog

1.0.2 — 2026-08-24

Removes a dashboard screenshot that showed an error toast. It was captured against a site where this plugin's API was unreachable, so it advertised a broken dashboard. No screenshot is better than a misleading one; a replacement will be taken against a working install.

1.0.1 — 2026-08-24

Package metadata only: the listing now carries an icon and search tags, and the project and repository links point at the organisation that actually hosts this code. No code changes.

1.0.0 — 2026-08-24

This package now keeps a changelog. Earlier releases predate it and are not reconstructed here — consult the repository history for those. From this version on, every release records what changed for someone using it.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 is compatible.  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 (1)

Showing the top 1 NuGet packages that depend on SplatDev.Logger:

Package Downloads
SplatDev.ScheduledTasks

Task scheduler with EF Core persistence and reflection-based invocation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 98 8/24/2026