![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.Logging.TraceSource --version 10.0.9
NuGet\Install-Package Microsoft.Extensions.Logging.TraceSource -Version 10.0.9
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Logging.TraceSource" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Logging.TraceSource" />Project file
paket add Microsoft.Extensions.Logging.TraceSource --version 10.0.9
#r "nuget: Microsoft.Extensions.Logging.TraceSource, 10.0.9"
#:package Microsoft.Extensions.Logging.TraceSource@10.0.9
#addin nuget:?package=Microsoft.Extensions.Logging.TraceSource&version=10.0.9Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Logging.TraceSource&version=10.0.9Install as a Cake Tool
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.
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.
The main types provided by this library are:
Microsoft.Extensions.Logging.TraceSource.TraceSourceLoggerProviderMicrosoft.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. |
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 |
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 |