RockLib.Logging 2.0.0

A simple logging library.

This package was built from the source code at

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

Release Notes

RockLib.Logging version 2.0.0

**Changes to ILogger interface**
- Add `LogProviders` property
 - The collection of log providers had been a private field of the Logger class; now it is exposed in the interface.
- Add `ErrorHandler` property
 - When set, it handles errors from log providers.
 - Can also be set using a delegate by calling the `SetErrorHandler` extension method for the `ILogger` interface.
- Add `ContextProviders` property
 - A collection of objects for customizing (e.g. adding extended properties to) outgoing logs before they are sent.
- Add `LogProcessor` property
 - Instead of the `Logger` class handling the processing of logs, either synchronously or asynchronously depending on the value of the `isSynchronous` constructor parameter, it delegates the main processing of logs to its log processor.
 - Can be set directly with an implementation of `ILogProcessor`, or by specifying the logger's processing mode - `Background`, `Synchronous`, or `FireAndForget`.
- Implement `IDisposable`
 - Previously, the `Logger` class implemented `IDisposable`, but not the `ILogger` interface.

**Changes to LoggerFactory**
- `LoggerFactory` is configuration-based instead of "configuration-based by default, otherwise able to specify collection of logger objects from which to choose from".
 - Has a `Configuration` property whose value determines what loggers the factory can produce.
 - The default configuration comes from the "RockLib.Logging" or "RockLib_Logging" section under `RockLib.Configuration.Config.Root`.
 - Can specify a custom configuration with the `SetConfiguration` method.
- Renames methods to be simpler and more explicit: `CreateFromConfig` -> `Create`; `GetInstance` -> `GetCached`
- Methods return `ILogger` instead of `Logger`
- Adds optional parameters to `LoggerFactory` methods
 - `defaultTypes`, `valueConverters`, and `resolver`
   - LoggerFactory uses the `RockLib.Configuration.ObjectFactory` library to actually create the `ILogger`.
- These values are used by the library to customize how the logger is created.
 - `reloadOnConfigChange`
   - The `RockLib.Configuration.ObjectFactory` library has the ability to create objects from configuration such that, when the configuration changes, the objects reload themselves automatically. `LoggerFactory` can use this ability.
- Default is `true`, meaning loggers will reload themselves when their configuration changes. Set to `false` if a config-reloading logger is not desired.

**Changes to LogEntry**
- Add new properties: correlationId, businessProcessId, and businessActivityId
 - These are also exposed as optional parameters in the logging extension methods.
- Make CallerInfo first-class property of LogEntry

**Changes to log providers**
- `FileLogProvider` synchronizes across all instances that use the same file
 - This means all instances of `FileLogProvider` that use the same file can write concurrently.
- `ConsoleLogProvider` can target either stdout or stderr

GitHub repositories (0)

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 299,790 4/25/2019
2.0.0-alpha11 335 4/19/2019
2.0.0-alpha10 277 4/5/2019
2.0.0-alpha09 204 3/27/2019
2.0.0-alpha08 188 3/26/2019
2.0.0-alpha07 192 3/21/2019
2.0.0-alpha06 1,376 3/4/2019
2.0.0-alpha05 164 3/1/2019
2.0.0-alpha04 181 2/28/2019
2.0.0-alpha03 1,862 1/4/2019
2.0.0-alpha02 224 1/3/2019
2.0.0-alpha01 194 10/22/2018
1.2.0 141,506 10/5/2018
1.1.0 73,239 8/3/2018
1.0.1 10,947 6/29/2018
1.0.0 6,806 6/19/2018
1.0.0-alpha08 467 5/24/2018