Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

NLog + log4net added NetStandard support #167

Merged
merged 4 commits into from
Apr 4, 2018

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Apr 1, 2018

Updated to NLog ver. 4.5.0 RTM
Updated to log4net ver. 2.0.8 RTM

Added support for Flush()

Resolves #155 + Resolves #68 + Resolves #115

@msftclas
Copy link

msftclas commented Apr 1, 2018

CLA assistant check
All CLA requirements met.

@snakefoot snakefoot force-pushed the develop branch 4 times, most recently from 514e768 to 2d5e2b1 Compare April 1, 2018 21:57
Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution! Please see comments in my review

@@ -41,9 +41,9 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.6.0-beta2" />
<PackageReference Include="log4net" Version="2.0.5" />
<PackageReference Include="log4net" Version="2.0.8" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this update required for the PR? Can the older version reference be kept for better compatibility?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see... older version doesn't have netstandard target.

Can you please enable optional reference here - older version for net45 and newer fro netstandard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now only using ver. 2.0.8 for netstandard, but I have to force log4net from 2.0.5 to 2.0.6 on net45 to support flush.

@@ -10,7 +10,7 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>

<TargetFrameworks>net45</TargetFrameworks>
<TargetFrameworks>netstandard1.3;net45</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the new target there should be corresponding test project. It will be basically a copy paste of net45. We copying them as Visual Studio test explorer doesn't understand yet multiuple target platfgorms in a single test project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have added netcore-unit-test-projects for NLog and log4net

Copy link
Contributor

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! I'll merge if there will be no more feedback by tomorrow.

Copy link
Contributor

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!
Can you please update changelog as well with a one liner describing this change/link to GH issue.
https://github.com/Microsoft/ApplicationInsights-dotnet-logging/blob/develop/CHANGELOG.md

@snakefoot
Copy link
Contributor Author

@cijothomas Updated changelog.md with a 3 liner


IDictionary<string, string> propertyBag;

if (trace is ExceptionTelemetry)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it help to use the ISupportProperties interface here? i.e.

propertyBag = ((ISupportProperties)trace).Properties;

Copy link
Contributor Author

@snakefoot snakefoot Apr 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just moving code around (stylecop) to fix the unit tests (No PrivateObject in NetCore)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. Fine to leave it as it is, then.


if (!string.IsNullOrEmpty(logEvent.LoggerName))
{
propertyBag.Add("LoggerName", logEvent.LoggerName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider nameof(logEvent.LoggerName)

Copy link
Contributor Author

@snakefoot snakefoot Apr 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just moving code around (stylecop) to fix the unit tests (No PrivateObject in NetCore)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine to leave it as it is, then.

CHANGELOG.md Outdated
### Version 2.6.0-beta3
- [NetStandard Support for NLog and log4net](https://github.com/Microsoft/ApplicationInsights-dotnet-logging/pull/167)
- [NLog and log4net can Flush](https://github.com/Microsoft/ApplicationInsights-dotnet-logging/pull/167)
- Update log4net reference to [2.0.6](https://www.nuget.org/packages/log4net/2.0.6)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're here, please could you also add a line indicating that we also added .Net Standard support for TraceListener:

- [NetStandard Support for TraceListener](https://github.com/Microsoft/ApplicationInsights-dotnet-logging/pull/166)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@304NotModified
Copy link

When will this be released?

Thanks in advance!

@SergeyKanzhelev
Copy link
Contributor

@MS-TimothyMothra is working on next beta as we speak. Timothy, can you confirm the estimated date of this release?

@TimothyMothra
Copy link
Member

Earliest will be end of next week (Apr 13th) maybe slipping to early the week of the 16th.

This release is dependent on dotnet and dotnet-server. Those are in progress now and should be finished early-mid next week. (Apr 9-11).

@snakefoot
Copy link
Contributor Author

Microsoft.ApplicationInsights.NLogTarget ver. 2.6.0-beta3 has been released:

https://www.nuget.org/packages/Microsoft.ApplicationInsights.NLogTarget/2.6.0-beta3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants