Skip to content

NLog.StructuredLogging.Json version 4.0.0 is released.
The package is here: https://www.nuget.org/packages/NLog.StructuredLogging.Json/4.0.0

This is a major release because of the breaking change in output format:

  • Numbers and booleans not output as strings #130

Also:

  • Downgrade the Full framework target version from 4.5.2 to 4.5 so that users still on this framework version can use the library #155

  • Enable compilation across all platforms, using Microsoft.NETFramework.ReferenceAssemblies at build time #156

Assets 2

@AnthonySteele AnthonySteele released this May 9, 2019 · 1 commit to master since this release

  • Downgrade the Full framework target version from 4.5.2 to 4.5 so that users still on this framework version can use the library #155
  • Enable compilation across all platforms, using Microsoft.NETFramework.ReferenceAssemblies at build time #156

These are build-time and metadata changes. These changes should have no impact over the previous beta for consumers on .NETCore 2.0 or later, NETStandard2.0 or .NET framework 4.5.2 or later.

As the "RC" name suggests, this is just a test to make sure that it all still works, and will be re-labelled 4.0.0 in about a week if all is well, and there are no further changes.

Assets 2

@AnthonySteele AnthonySteele released this Mar 1, 2019 · 8 commits to master since this release

First beta of 4.0.0,

  • Numbers and booleans not output as strings #130

This is a breaking change to the output format.
The usage in C# code is unchanged: Binary and source compatibility is preserved at that end.

Assets 2
Mar 1, 2019
version 4.0.0 beta 01

@AnthonySteele AnthonySteele released this Feb 9, 2019 · 20 commits to master since this release

NLog.StructuredLogging.Json version 3.0.0 is released.

This is a major version release because of the change in #118 which breaks binary compatibility.
Existing code should still work as before, after recompiling with NLog.StructuredLogging.Json version 3.0.0.

This release is not a return to full active development of this library, as this is unnecessary. It is maintenance to make sure that it keeps working as well as before, and supports a new scenario.

Allow default null for extended data

Pull Request #118

Standard usage is e.g. _logger.ExtendedInfo("Order placed", new { OrderId = 1234 });

But if you have no properties to add, you use an empty properties object: _logger.ExtendedInfo("Order placed", new { }); or a null: _logger.ExtendedInfo("Order placed", null); .

This change also allows _logger.ExtendedInfo("Order placed"); as there is a default value of null for the properties.

Compatibility with the ILogger abstraction

Pull Request #126

Compatibility with the ILogger abstraction in Microsoft.Extensions.Logging.Abstractions and message templates used therein.

This is useful if you use libraries that need an ILogger implementation (such as JustSaying V6) and want the output to go to structured JSON files.

How to ensure that you can use ILogger with this library's JSON formatted output:

ILogger example

When _logger is an ILogger instance set up as above, and the code is:

_logger.LogInformation("Templated information for order {OrderId} at {CustomProperty}",  
    12345, DateTime.UtcNow);

The log entry will be like this:

{
  "TimeStamp":"2019-01-29T11:12:46.609Z",
  "Level":"Info",
  "LoggerName":"LogDemo.HomeController",
  "Message":"Templated information for order 12345 at 01/29/2019 11:12:46",
  "MessageTemplate":"Templated information for order {OrderId} at {CustomProperty}",
  "OrderId": 12345,
  "CustomProperty":"2019-01-29T11:12:46.6210834Z"
}
Assets 2

There should not be breaking changes for full .NETFramework

Targets
.NETFramework 4.5.2
.NETStandard 2.0

Dependencies
Newtonsoft.Json (>= 9.0.1)
NLog (>= 4.5.0)

Assets 2
You can’t perform that action at this time.