VOOZH about

URL: https://www.nuget.org/packages/com.parallon.outpatient.serilog.sdk/

⇱ NuGet Gallery | com.parallon.outpatient.serilog.sdk 1.0.9




com.parallon.outpatient.serilog.sdk 1.0.9

dotnet add package com.parallon.outpatient.serilog.sdk --version 1.0.9
 
 
NuGet\Install-Package com.parallon.outpatient.serilog.sdk -Version 1.0.9
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="com.parallon.outpatient.serilog.sdk" Version="1.0.9" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="com.parallon.outpatient.serilog.sdk" Version="1.0.9" />
 
Directory.Packages.props
<PackageReference Include="com.parallon.outpatient.serilog.sdk" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add com.parallon.outpatient.serilog.sdk --version 1.0.9
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: com.parallon.outpatient.serilog.sdk, 1.0.9"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package com.parallon.outpatient.serilog.sdk@1.0.9
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=com.parallon.outpatient.serilog.sdk&version=1.0.9
 
Install as a Cake Addin
#tool nuget:?package=com.parallon.outpatient.serilog.sdk&version=1.0.9
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

LoggingConfigurator for ASP.NET Core (.NET 8, C# 12)

Overview

LoggingConfigurator is a singleton utility designed to configure Serilog logging in ASP.NET Core applications. It centralizes logging setup, enables dynamic log level changes at runtime, and integrates with the .NET dependency injection system.

Features

  • Singleton pattern ensures consistent logging configuration
  • Dynamic log level control using LoggingLevelSwitch
  • Reads configuration from appsettings.json, environment-specific files, and environment variables
  • Replaces default logging providers with Serilog
  • Registers LoggingLevelSwitch for dependency injection

Usage

  1. Add NuGet Packages

    • Serilog.AspNetCore
    • Serilog.Settings.Configuration
    • Serilog.Sinks.Console (or any other sinks you require)
  2. Configure in Program.cs

    Use LoggingConfigurator to set up Serilog as your logging provider.

  3. Dynamic Log Level Control

    Inject LoggingLevelSwitch where needed to change log levels at runtime.

  4. Configuration

    Add Serilog settings to your appsettings.json.

Configuration Example

Add the following Serilog section to your appsettings.json:

{
 "Serilog": {
 "Using": [ "Serilog.Sinks.GoogleCloudLogging" ],
 "Enrich": [
 "FromLogContext",
 "WithMachineName",
 "WithEnvironmentName",
 "WithEnvironmentUserName",
 "WithThreadId",
 "WithThreadName",
 "WithProcessId",
 "WithProcessName"
 ],
 "MinimumLevel": {
 "Default": "Information",
 "Override": {
 "Microsoft": "Warning",
 "Microsoft.AspNetCore": "Warning",
 "System": "Warning"
 }
 },
 "WriteTo": [
 {
 "Name": "GoogleCloudLogging",
 "Args": {
 "projectId": "${SERILOG__WRITETO__0__ARGS__PROJECTID}", // Uses environment variable substitution for configuration
 "logName": "${SERILOG__WRITETO__0__ARGS__LOGNAME}",
 "outputTemplate": "${SERILOG__WRITETO__0__ARGS__OUTPUTTEMPLATE}",
 "useSourceContextAsLogName": false,
 "labels": {
 "environment": "${SERILOG__WRITETO__0__ARGS__LABELS__ENVIRONMENT}",
 "Label1": "${SERILOG__WRITETO__0__ARGS__LABELS__LABEL1}",
 "Label2": "${SERILOG__WRITETO__0__ARGS__LABELS__LABEL2}"
 }
 }
 }
 ]
 },
 "AllowedHosts": "*"
 // Other configuration settings...
}

This example demonstrates how to configure Serilog with Google Cloud Logging and various enrichers in your appsettings.json.

License

See the project license for details.

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.9 328 6/19/2025
1.0.8 227 6/18/2025
1.0.7 369 5/20/2025
1.0.6 241 5/20/2025
1.0.5 348 4/30/2025
1.0.2 296 4/15/2025
1.0.1 268 4/15/2025
1.0.0 261 4/15/2025

Initial release.