Alveus.Common.Logging (0.0.2)
Published 2025-10-03 10:02:46 +02:00 by mike
Installation
dotnet nuget add source --name public --username your_username --password your_token
dotnet add package --source public --version 0.0.2 Alveus.Common.Logging
About this package
Provides common logging setup using Serilog.
Alveus.Common.Logging
A .NET library that provides common logging setup using Serilog with enriched logging capabilities and multiple sink options.
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
{
SeqServerUrl = "http://localhost:5341",
MinimumLogLevel = LogLevel.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-10-03 10:02:46 +02:00
Assets (4)
Versions (2)
View all
NuGet
2
Alveus Dev (https://alveus.dev)
29 KiB
alveus.common.logging.nuspec
1.6 KiB
alveus.common.logging.pdb
11 KiB