NTrace 1.0.0.50

Trace Management for .NET

Install-Package NTrace -Version 1.0.0.50
dotnet add package NTrace --version 1.0.0.50
<PackageReference Include="NTrace" Version="1.0.0.50" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NTrace --version 1.0.0.50
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Introduction

Trace is a trace management for logging operations in .NET.

Its purpose is to encapsulate trace operations for different locations (e.g. console, file etc.). In addition trace messages can be categorized to be filtered at application level. The following sections show the details

Trace Service Management

The core component is the trace management service which controls registered tracers and handles also the categories. Only messages matching the wanted categories will be processed by each known tracer

Register Tracers

Initially no tracers are known to the service. To associate a tracer it has to be registered. This is a task that is done at the very beginning of each application. A tracer has to implement the ITracer interface.
In the current release there are only a few build-in tracers available. This will grow in the future.

Build-In Tracers

For the current release there are the following build-in tracers available:

  • ConsoleTracer
  • FileTracer
  • DelegateTracer

Tracer-Adapters

NLog is supported via an adapter, check out NuGet package NTrace.Adapters.NLog for more information

Trace Types

A message can be traced of a specific type, like:

  • Error
  • Warning
  • Information

Trace Categories

To control the purpose of a traced message, it can be assigned a specific category. The following categories are available right now:

  • Application
  • Connection
  • Method
  • Data
  • Query
  • Debug

At application level, these categories can be combined (e.g. Data | Query) where you only want to see those data in you log to keep it clean.
But if writing an error, the message will be traced, regardless of the filtered category.

IoC Support

NTrace is designed for the use in an IoC (Inversion of Control scenario) environment. For that it provides an interface ITraceService.

Introduction

Trace is a trace management for logging operations in .NET.

Its purpose is to encapsulate trace operations for different locations (e.g. console, file etc.). In addition trace messages can be categorized to be filtered at application level. The following sections show the details

Trace Service Management

The core component is the trace management service which controls registered tracers and handles also the categories. Only messages matching the wanted categories will be processed by each known tracer

Register Tracers

Initially no tracers are known to the service. To associate a tracer it has to be registered. This is a task that is done at the very beginning of each application. A tracer has to implement the ITracer interface.
In the current release there are only a few build-in tracers available. This will grow in the future.

Build-In Tracers

For the current release there are the following build-in tracers available:

  • ConsoleTracer
  • FileTracer
  • DelegateTracer

Tracer-Adapters

NLog is supported via an adapter, check out NuGet package NTrace.Adapters.NLog for more information

Trace Types

A message can be traced of a specific type, like:

  • Error
  • Warning
  • Information

Trace Categories

To control the purpose of a traced message, it can be assigned a specific category. The following categories are available right now:

  • Application
  • Connection
  • Method
  • Data
  • Query
  • Debug

At application level, these categories can be combined (e.g. Data | Query) where you only want to see those data in you log to keep it clean.
But if writing an error, the message will be traced, regardless of the filtered category.

IoC Support

NTrace is designed for the use in an IoC (Inversion of Control scenario) environment. For that it provides an interface ITraceService.

Release Notes

Features:

- [#57] - Add support of delegates as a tracer
- [#58] - Add support of NLog as a tracer
- [#59] - Improved writing of string data (containing quotes)

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0.50 35 9/10/2019
0.5.0.47 157 10/22/2018
0.4.0.46 131 10/19/2018
0.3.0.45 171 10/10/2018
0.2.0.41 147 9/27/2018