RockLib.Logging 2.0.0

A simple logging library.

This package was built from the source code at https://github.com/RockLib/RockLib.Logging/tree/5cf56003bab409762f40a0994a5d7aaa79b09ade

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

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.0.0 58,437 4/25/2019
2.0.0-alpha11 251 4/19/2019
2.0.0-alpha10 198 4/5/2019
2.0.0-alpha09 130 3/27/2019
2.0.0-alpha08 124 3/26/2019
2.0.0-alpha07 124 3/21/2019
2.0.0-alpha06 753 3/4/2019
2.0.0-alpha05 96 3/1/2019
2.0.0-alpha04 111 2/28/2019
2.0.0-alpha03 1,758 1/4/2019
2.0.0-alpha02 159 1/3/2019
2.0.0-alpha01 129 10/22/2018
1.2.0 98,356 10/5/2018
1.1.0 54,389 8/3/2018
1.0.1 7,313 6/29/2018
1.0.0 4,533 6/19/2018
1.0.0-alpha08 339 5/24/2018