Alveus.Common.Logging (0.0.3)
Published 2025-11-09 17:05:45 +01:00 by mike
Installation
dotnet nuget add source --name public --username your_username --password your_token dotnet add package --source public --version 0.0.3 Alveus.Common.LoggingAbout this package
Provides common logging setup using Serilog.
Alveus.Common.Logging
A .NET library that wraps around Serilog to provide a simple interface to set up logging by either providing the configuration class instance, or by passing in IConfiguration to bind against the app settings.
Overview
This library simplifies the setup of structured logging in .NET applications using Serilog. It provides:
- Easy integration with dependency injection
- Environment and exception enrichment
- Console and Seq sink support
- Flexible configuration options
Installation
Install the package via NuGet feed https://nuget.alveus.dev
Usage Example
Here's a basic example of how to set up logging in your application:
var serviceCollection = new ServiceCollection();
// Define your logging configuration
var loggingConfig = new LoggingConfig
{
MinimumLevel = LogEventLevel.Information
};
// Set up logging with the configuration
serviceCollection.SetupLogging(loggingConfig, loggerConfiguration =>
{
// Additional customization of Serilog goes here
loggerConfiguration.Enrich.WithProperty("Application", "MyApp");
});
// Build the service provider
var serviceProvider = serviceCollection.BuildServiceProvider();
// Resolve the logger and use it
var logger = serviceProvider.GetRequiredService<ILogger<Program>>();
logger.LogInformation("Custom configuration applied successfully");
Dependencies
Details
2025-11-09 17:05:45 +01:00
Assets (4)
Versions (3)
View all
NuGet
40
Alveus Dev (https://alveus.dev)
30 KiB
alveus.common.logging.nuspec
1.6 KiB
alveus.common.logging.pdb
11 KiB