Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MessageProperties - Allow capture of message properties (CaptureMessageProperties option) #148

Merged
merged 1 commit into from
Oct 15, 2017

Conversation

snakefoot
Copy link
Contributor

Using ILogger-state and ILogger-scope. Resolves NLog/NLog#1366

@snakefoot snakefoot force-pushed the master branch 2 times, most recently from cf94721 to cbc0bca Compare October 15, 2017 09:39
var target = GetTarget();
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 property |01", target.Logs.FirstOrDefault());

GetRunner().LogWithScopeParameters();
Copy link
Member

Choose a reason for hiding this comment

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

Don't we need an assert after this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved into seperate test

@@ -27,6 +27,11 @@ public class NLogProviderOptions
/// </summary>
public bool CaptureMessageTemplates { get; set; }

/// <summary>
/// Enable conversion of
Copy link
Member

Choose a reason for hiding this comment

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

Please complete the sentence :)

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 :)

@@ -118,6 +105,44 @@ private LogEventInfo CreateLogEventInfo(LogLevel nLogLogLevel, string message, I
return LogEventInfo.Create(nLogLogLevel, _logger.Name, message);
}

private void CaptureEventId(EventId eventId, LogEventInfo eventInfo)
Copy link
Member

Choose a reason for hiding this comment

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

👍 for splitting up in methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes the optimizations had suddenly made it a little convoluted

@304NotModified
Copy link
Member

Thx!

@304NotModified 304NotModified added this to the 1.0 rc1 milestone Oct 15, 2017
@304NotModified 304NotModified changed the title MessageProperties - Allow capture of message properties MessageProperties - Allow capture of message properties (CaptureMessageProperties option) Oct 15, 2017
@snakefoot
Copy link
Contributor Author

snakefoot commented Nov 24, 2017

Added documentation about how to include NLog properties:

https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-properties-with-Microsoft-Extension-Logging

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

Successfully merging this pull request may close these issues.

2 participants