-
Notifications
You must be signed in to change notification settings - Fork 151
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
Conversation
cf94721
to
cbc0bca
Compare
test/LoggerTests.cs
Outdated
var target = GetTarget(); | ||
Assert.Equal("NLog.Extensions.Logging.Tests.LoggerTests.Runner|DEBUG|message with id and 1 property |01", target.Logs.FirstOrDefault()); | ||
|
||
GetRunner().LogWithScopeParameters(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please complete the sentence :)
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Thx! |
…er-state and ILogger-scope
Added documentation about how to include NLog properties: |
Using ILogger-state and ILogger-scope. Resolves NLog/NLog#1366