MaverickLogging 1.0.0
dotnet add package MaverickLogging --version 1.0.0
NuGet\Install-Package MaverickLogging -Version 1.0.0
<PackageReference Include="MaverickLogging" Version="1.0.0" />
<PackageVersion Include="MaverickLogging" Version="1.0.0" />
<PackageReference Include="MaverickLogging" />
paket add MaverickLogging --version 1.0.0
#r "nuget: MaverickLogging, 1.0.0"
#:package MaverickLogging@1.0.0
#addin nuget:?package=MaverickLogging&version=1.0.0
#tool nuget:?package=MaverickLogging&version=1.0.0
Maverick.Logging
A standardized, production-ready logging package for .NET applications built on Microsoft.Extensions.Logging and Serilog.
Overview
Maverick.Logging provides a consistent logging implementation across all applications with:
- Structured logging via Serilog
- Rolling file logs
- Dedicated error logs
- Domain-specific logs (IMAP, SECURITY)
- Runtime log level switching (no restart required)
- Clean integration with
ILogger<T>
Installation
From Local NuGet Source
dotnet add package Maverick.Logging --source LocalNuget
Or via Visual Studio:
- Go to Tools → NuGet Package Manager → Package Manager Settings
- Add a new source:
- Name:
LocalNuget - Source:
C:\Maverick\Nuget(or your configured path)
- Name:
- Install
Maverick.Logging
Quick Start (Required Setup)
In Program.cs:
using Maverick.Logging;
var builder = WebApplication.CreateBuilder(args);
var logRoot = Path.Combine(
builder.Environment.ContentRootPath,
"Logs");
builder.Logging.AddMaverickLogging(
builder.Environment,
builder.Configuration,
logRoot,
builder.Environment.ApplicationName);
Output Structure
Logs are written to:
<ContentRoot>\Logs\
Files generated:
| File | Purpose |
|---|---|
AppName-YYYYMMDD.log |
All log events |
Error-YYYYMMDD.log |
Errors only |
IMAP-YYYYMMDD.log |
IMAP-specific events |
Security-YYYYMMDD.log |
Security events |
Logging Usage
Standard Logging
logger.LogInformation("Application started");
Error Logging
logger.LogError(ex, "Unhandled exception occurred");
IMAP Logging (Custom Channel)
logger
.ForContext("IMAP", true)
.Information("Connected to mailbox");
Security Logging (Custom Channel)
logger
.ForContext("SECURITY", true)
.Warning("Unauthorized access attempt");
Log Levels by Environment
| Environment | Default Level |
|---|---|
| Development | Debug |
| Staging | Information |
| Production | Warning |
Dynamic Log Level Changes
You can change logging levels at runtime via appsettings.json.
{
"Serilog": {
"MinimumLevel": {
"Default": "Information"
}
}
}
Requires
reloadOnChange: truein configuration.
Filtering Behavior
The following noisy categories are suppressed by default:
- Microsoft → Warning+
- System → Warning+
- Microsoft.Hosting.Lifetime → Disabled
- Kestrel → Disabled
Developer Requirements
To use this package correctly:
- Always inject
ILogger<T> - Use structured logging (avoid string concatenation)
- Use context properties for domain-specific logs (IMAP, SECURITY)
Example
public class EmailService
{
private readonly ILogger<EmailService> _logger;
public EmailService(ILogger<EmailService> logger)
{
_logger = logger;
}
public void Connect()
{
_logger.ForContext("IMAP", true)
.Information("Connecting to IMAP server");
}
}
Versioning Strategy
- Patch: Bug fixes
- Minor: Backward-compatible enhancements
- Major: Breaking changes
Recommended Practices
- Do not log sensitive data (passwords, tokens)
- Use
LogErrorfor exceptions (always includeex) - Prefer structured logging:
logger.LogInformation("User {UserId} logged in", userId);
Troubleshooting
Logs not appearing
- Verify
logRootpath exists - Ensure app has write permissions
- Confirm package is installed
Log level not updating
- Ensure
reloadOnChange = true - Verify correct JSON path:
Serilog:MinimumLevel:Default
Future Enhancements (Planned)
- Correlation ID middleware
- Distributed tracing support
- Optional sinks (Seq, Elastic, App Insights)
Ownership
Maintained by Maverick development team.
For changes, update the package and increment version in .csproj.
| Product | Versions 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. |
-
net9.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.14)
- Microsoft.Extensions.Logging.Console (>= 9.0.14)
- Serilog (>= 3.1.1)
- Serilog.AspNetCore (>= 8.0.0)
- Serilog.Extensions.Logging (>= 8.0.0)
- Serilog.Sinks.File (>= 5.0.0)
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.0 | 227 | 3/29/2026 |