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

ID Version Target Framework
Microsoft.Extensions.Configuration.Binder 9.0.9 .NETStandard2.0
Microsoft.Extensions.Logging 9.0.9 .NETStandard2.0
Serilog 4.3.0 .NETStandard2.0
Serilog.Enrichers.Environment 3.0.1 .NETStandard2.0
Serilog.Exceptions 8.4.0 .NETStandard2.0
Serilog.Extensions.Logging 9.0.2 .NETStandard2.0
Serilog.Sinks.Console 6.0.0 .NETStandard2.0
Serilog.Sinks.Seq 9.0.0 .NETStandard2.0
Details
NuGet
2025-10-03 10:02:46 +02:00
1
Alveus Dev (https://alveus.dev)
29 KiB
Assets (4)
Versions (2) View all
0.0.2 2025-10-03
0.0.1 2025-10-03