VOOZH about

URL: https://www.nuget.org/packages/Microsoft.Extensions.Logging.TraceSource

⇱ NuGet Gallery | Microsoft.Extensions.Logging.TraceSource 10.0.9




👁 Image
Microsoft.Extensions.Logging.TraceSource 10.0.9

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.Extensions.Logging.TraceSource --version 10.0.9
 
 
NuGet\Install-Package Microsoft.Extensions.Logging.TraceSource -Version 10.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="Microsoft.Extensions.Logging.TraceSource" Version="10.0.9" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.Logging.TraceSource" Version="10.0.9" />
 
Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" />
 
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 Microsoft.Extensions.Logging.TraceSource --version 10.0.9
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.Extensions.Logging.TraceSource, 10.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 Microsoft.Extensions.Logging.TraceSource@10.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=Microsoft.Extensions.Logging.TraceSource&version=10.0.9
 
Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Logging.TraceSource&version=10.0.9
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About

Implements a trace logger provider for the .NET logging infrastructre facilitating enhanced logging capabilities and trace-level diagnostics in application by writing messages to a trace listener using System.Diagnostic.TraceSource.

Key Features

  • Seamless integration with .NET logging infrastructure.
  • Fine-grained control over trace messages using SourceSwitch.
  • A set of builder methods to configure logging infrastructure.

How to Use

The Microsoft.Extensions.Logging.TraceSource library provides extension methods to the logger factory and the logger builder to add a trace source with trace listeners.

using System.Diagnostics;
using Microsoft.Extensions.Logging;

using var consoleTraceListener = new ConsoleTraceListener();
using var textWriterTraceListener = new TextWriterTraceListener("/traces.txt");
using var loggerFactory = LoggerFactory.Create(builder =>
{
 builder
 .AddTraceSource(new SourceSwitch("Something") { Level = SourceLevels.All }, consoleTraceListener)
 .AddTraceSource(new SourceSwitch("HouseKeeping") { Level = SourceLevels.All }, textWriterTraceListener);
});

var logger = loggerFactory.CreateLogger<Program>();

logger.LogInformation("Information message.");
// Program Information: 0 : Information message.
logger.LogWarning("Warning message.");
// Program Warning: 0 : Warning message.

var traceSource = new TraceSource("HouseKeeping", SourceLevels.All);
traceSource.Listeners.Add(consoleTraceListener);
traceSource.Listeners.Add(textWriterTraceListener);

traceSource.TraceEvent(TraceEventType.Error, 0, "Error message.");
//HouseKeeping Error: 0 : Error message.

Main Types

The main types provided by this library are:

  • Microsoft.Extensions.Logging.TraceSource.TraceSourceLoggerProvider

Additional Documentation

Related Packages

Feedback & Contributing

Microsoft.Extensions.Logging.TraceSource is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  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 is compatible.  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 is compatible.  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. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 is compatible.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (22)

Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Logging.TraceSource:

Package Downloads
Microsoft.AspNetCore.App

Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

Microsoft.AspNetCore.All

Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

SuperOffice.NetServer.Core

SuperOffice NetServer Core is SuperOffice's data access technology for new applications. This is for onsite installations with the same version. This also works with SuperOffice Online.

EasyNetQ-dotnet-core

EasyNetQ

Egelke.EHealth.Etee.Crypto

.Net End-To-End Encryption Library for eHealth

GitHub repositories (8)

Showing the top 8 popular GitHub repositories that depend on Microsoft.Extensions.Logging.TraceSource:

Repository Stars
mongodb/mongo-csharp-driver
The Official C# .NET Driver for MongoDB
Decimation/SmartImage
Reverse image search tool (SauceNao, IQDB, Ascii2D, trace.moe, and more)
ohadschn/letsencrypt-webapp-renewer
[PLEASE USE FREE MS MANAGED CERTS INSTEAD] Simple WebJob-ready console application for renewing Azure Web App SSL certificates
ProfessionalCSharp/MoreSamples
Additional code samples the book series Professional C#, Wrox Press
TurnerSoftware/InfinityCrawler
A simple but powerful web crawler library for .NET
witskeeper/geektime
elgarf/vMixUTC
Customizable controller for vMix
jiangjinnan/InsideAspNet6
Version Downloads Last Updated
11.0.0-preview.5.26302.115 75 6/9/2026
11.0.0-preview.4.26230.115 143 5/12/2026
11.0.0-preview.3.26207.106 167 4/14/2026
11.0.0-preview.2.26159.112 187 3/10/2026
11.0.0-preview.1.26104.118 152 2/10/2026
10.0.9 1,920 6/9/2026
10.0.8 5,827 5/12/2026
10.0.7 12,714 4/21/2026
10.0.6 3,301 4/14/2026
10.0.5 10,429 3/12/2026
10.0.4 2,510 3/10/2026
10.0.3 15,525 2/10/2026
10.0.2 285,050 1/13/2026
10.0.1 155,751 12/9/2025
9.0.17 161 6/9/2026
9.0.16 511 5/12/2026
9.0.15 1,039 4/14/2026
9.0.14 1,374 3/10/2026
9.0.13 1,732 2/10/2026
9.0.12 2,059 1/13/2026
Loading failed