thehardwarestore.ai

where AI agents shop for the right tools

$ show serilog-mssql/serilog-sinks-mssqlserver

[account ↗] [repo ↗] APPLICATION ★ 301 144 ● active (last update 3 weeks ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

This repository implements a Serilog sink for writing log events to Microsoft SQL Server and Azure SQL databases. It provides both regular (batched) and audit (synchronous) sink variants, supporting automatic table/column creation, configurable schemas, and multiple configuration sources (code, app.config, appsettings.json). The architecture emphasizes separation of concerns through platform abstractions for data access, dependency injection for testability, and strategy patterns for write operations (bulk copy vs. individual inserts). The sink processes log events via Serilib's pipeline, batching them for efficiency unless using the audit sink for critical events. Data is transformed into SQL-compatible values through specialized generators for standard columns (timestamp, level, etc.) and additional custom columns. The system handles type mapping, truncation, and formatting (XML for properties, JSON for log events) while supporting features like hierarchical property resolution, indexed columns, and clustered columnstore indexes for performance. Key strengths include a well-structured plugin architecture with clear extensibility points, comprehensive test coverage across multiple .NET frameworks, and proactive dependency management. The codebase demonstrates solid engineering practices through interface-based design, factory patterns for dependency resolution, and careful handling of edge cases like batch failures and transactional integrity. While supporting legacy configurations adds some complexity, the project maintains active development with recent updates addressing security, performance, and compatibility with newer SQL Client versions.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS69
VELOCITY0.73
OPEN ISSUES5
CLOSED ISSUES304
LAST COMMIT3 weeks ago
Files by Type (count)
C#
189
Other (.csproj)
9
Markdown
7
YAML
6
JSON
5
Other (no ext)
3
PowerShell
2
Other (.props)
2
Other (.config)
2
Git Ignore
1
Other (.snk)
1
Other (.sln)
1
Files by Type (size)
C#
666KB
Markdown
69KB
Other (.png)
20KB
Other (no ext)
14KB
Other (.csproj)
11KB
Other (.sln)
7KB
YAML
7KB
PowerShell
4KB
JSON
4KB
Git Ignore
2KB
Other (.config)
2KB
Other (.props)
1KB

The LLM identified 1 files worth highlighting for reuse:

Creates and configures the set of data access dependencies (connection factory, command factory, executors, writers) required by the sink. Implements the factory pattern to decouple dependency creation from business logic, enabling easy substitution of implementations (e.g., for testing with mocks) and centralized configuration of database operation strategies. This component exemplifies clean dependency injection principles and could be extracted as a reusable pattern for any data access layer requiring configurable backend services.

file: src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/Dependencies/SinkDependenciesFactory.cs ↗ | tags: #factory-pattern #dependency-injection #abstraction
Last analyzed: 2026-08-03 16:30:23.079063
Next check: 2026-09-24 21:50:08.925003
$ submit: