Franz.Common.Logging
1.2.62
dotnet add package Franz.Common.Logging --version 1.2.62
NuGet\Install-Package Franz.Common.Logging -Version 1.2.62
<PackageReference Include="Franz.Common.Logging" Version="1.2.62" />
paket add Franz.Common.Logging --version 1.2.62
#r "nuget: Franz.Common.Logging, 1.2.62"
// Install Franz.Common.Logging as a Cake Addin #addin nuget:?package=Franz.Common.Logging&version=1.2.62 // Install Franz.Common.Logging as a Cake Tool #tool nuget:?package=Franz.Common.Logging&version=1.2.62
Franz.Common.Logging
A comprehensive logging library within the Franz Framework, designed to enhance application monitoring and diagnostics using Serilog and Elastic APM. This package provides tools for centralized logging, tracing, and seamless integration with ASP.NET Core applications.
Features
- Centralized Logging:
- Integrates with Serilog for structured and enriched logging.
- Tracing Utilities:
TraceHelper
for advanced tracing support in distributed applications.
- Host Extensions:
HostBuilderExtensions
for configuring logging and tracing in application startup.
- Elastic APM Integration:
- Provides support for Elastic APM to monitor application performance and detect issues.
Version Information
- Current Version: 1.2.62
- Part of the private Franz Framework ecosystem.
Dependencies
This package relies on:
- Elastic.Apm.NetCoreAll (1.25.1): Full integration with Elastic APM for application performance monitoring.
- Elastic.Apm.SerilogEnricher (8.6.1): Enriches Serilog logs with Elastic APM trace data.
- Serilog.AspNetCore (8.0.0): Enables Serilog integration in ASP.NET Core applications.
- Serilog.Enrichers.Demystifier (1.0.2): Enhances log messages by providing demystified stack traces.
- Serilog.Enrichers.Environment (2.3.0): Adds environment-based enrichments to log data.
Installation
From Private Azure Feed
Since this package is hosted privately, configure your NuGet client:
dotnet nuget add source "https://your-private-feed-url" \
--name "AzurePrivateFeed" \
--username "YourAzureUsername" \
--password "YourAzurePassword" \
--store-password-in-clear-text
Install the package:
dotnet add package Franz.Common.Logging --version 1.2.62
Usage
1. Configure Logging in Host Builder
Use HostBuilderExtensions
to configure logging and tracing:
using Franz.Common.Logging.Extensions;
var host = Host.CreateDefaultBuilder(args)
.UseLoggingWithElasticApm() // Configures Serilog and Elastic APM
.Build();
await host.RunAsync();
2. Add Custom Tracing
Leverage TraceHelper
to add custom tracing to your application:
using Franz.Common.Logging.Tracing;
TraceHelper.TraceInformation("Starting application initialization...");
// Add custom trace messages as needed
TraceHelper.TraceWarning("Potential configuration issue detected.");
3. Enrich Log Data
Take advantage of Serilog enrichers for enhanced log metadata:
Log.Logger = new LoggerConfiguration()
.Enrich.WithEnvironmentName()
.Enrich.WithDemystifiedStackTraces()
.Enrich.WithElasticApmCorrelationInfo()
.WriteTo.Console()
.CreateLogger();
4. Monitor Performance with Elastic APM
Ensure Elastic APM is set up and logs include performance-related trace data. Add Elastic APM server configurations in appsettings.json
:
{
"ElasticApm": {
"ServerUrls": "http://localhost:8200",
"ServiceName": "MyApplication"
}
}
Integration with Franz Framework
The Franz.Common.Logging package integrates seamlessly with:
- Franz Framework: Acts as the central logging mechanism for all Franz libraries.
- Elastic APM: Enables distributed tracing and performance monitoring.
- Serilog: Provides structured logging and enrichments for ASP.NET Core applications.
Contributing
This package is part of a private framework. Contributions are limited to the internal development team. If you have access, follow these steps:
- Clone the repository.
- Create a feature branch.
- Submit a pull request for review.
License
This library is licensed under the MIT License. See the LICENSE
file for more details.
Changelog
Version 1.2.62
- Integrated Serilog and Elastic APM enrichers for structured logging.
- Added
TraceHelper
for advanced tracing support. - Introduced
HostBuilderExtensions
for simplified logging configuration.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
-
net8.0
- Elastic.Apm.NetCoreAll (>= 1.25.1)
- Elastic.Apm.SerilogEnricher (>= 8.6.1)
- Serilog.AspNetCore (>= 8.0.0)
- Serilog.Enrichers.Demystifier (>= 1.0.2)
- Serilog.Enrichers.Environment (>= 2.3.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Franz.Common.Logging:
Package | Downloads |
---|---|
Franz.Common.Messaging.Hosting
Shared utility library for the Franz Framework. |
|
Franz.Common.Bootstrap
Shared utility library for the Franz Framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.2.62 | 106 | 1/8/2025 |