Releases: justeat/NLog.StructuredLogging.Json
Version 4.0.0
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:
v4.0.0 Release Candidate 01
- Downgrade the Full framework target version from
4.5.2
to4.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.
Version 4.0.0 beta 001
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.
Version 3.0.0
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:
- Make sure that you use the
NLog
package at version4.5.0
or later. - Make sure that you use the
NLog.StructuredLogging.Json
package at version3.0.0
or later. - Install the NLog package for
ILogger
compatibility - NLog.Web.AspNetCore or NLog.Extensions.Logging. - Follow the instructions there to set it up.
- Log using message templates.
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"
}
StructuredLogging v2.0.0, with support for NetStandard 2.0
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)