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

${guid}, added GeneratedFromLogEvent #2226

Merged
merged 1 commit into from
Sep 17, 2017

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Jul 25, 2017

LogEvent will output the same Guid for all Targets. Resolves #60 (And maybe #107)

@codecov
Copy link

codecov bot commented Jul 25, 2017

Codecov Report

Merging #2226 into master will increase coverage by <1%.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master   #2226    +/-   ##
=======================================
+ Coverage      82%     82%   +<1%     
=======================================
  Files         304     304            
  Lines       21380   21399    +19     
  Branches     2577    2578     +1     
=======================================
+ Hits        17470   17489    +19     
  Misses       3256    3256            
  Partials      654     654

byte i = (byte)(LogEventInfo.ZeroDate.Ticks >> 16);
byte j = (byte)(LogEventInfo.ZeroDate.Ticks >> 8);
byte k = (byte)(LogEventInfo.ZeroDate.Ticks);
builder.Append(new Guid(logEvent.SequenceID, (short)logEvent.TimeStamp.Month, (short)logEvent.TimeStamp.Year, d, e, f, g, h, i, j, k).ToString(this.Format));
Copy link
Member

Choose a reason for hiding this comment

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

Clever approach!

But is this really a guid? (Global, unique)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is global unique identifier of a LogEvent within the running application. But probably not global in the universe.

@snakefoot snakefoot force-pushed the GuidLayoutRendererLogEvent branch 2 times, most recently from 93b600e to 6c32da1 Compare July 29, 2017 13:09
@304NotModified 304NotModified added this to the 4.5 milestone Aug 4, 2017
/// Generate the Guid from the NLog LogEvent (Will be the same for all targets)
/// </summary>
[DefaultValue(false)]
public bool LogEventGuid { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

What about "basedOnLogEvent"? Or "GeneratedFromLogEvent"

Copy link
Member

Choose a reason for hiding this comment

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

@snakefoot ? Your opinion please :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to GeneratedFromLogEvent

@304NotModified 304NotModified merged commit 2372394 into NLog:master Sep 17, 2017
@304NotModified 304NotModified changed the title GuidLayoutRenderer - Unique guid per LogEvent ${guid}, added GeneratedFromLogEvent Sep 17, 2017
@304NotModified 304NotModified modified the milestones: 4.5, 4.5 beta 1, 4.5 beta 2 Sep 30, 2017
@snakefoot snakefoot deleted the GuidLayoutRendererLogEvent branch October 10, 2017 20:43
@snakefoot snakefoot mentioned this pull request Nov 23, 2017
@snakefoot snakefoot modified the milestones: 4.5 beta 2, 4.5 Aug 22, 2023
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.

None yet

2 participants