jonwagner / EventSourceProxy

EventSourceProxy (ESP) is the easiest way to add scalable Event Tracing for Windows (ETW) logging to your .NET program
Other
97 stars 20 forks source link

Added a new TraceMethodAttribute which provides a way for consumers t… #40

Closed JerretK closed 9 years ago

JerretK commented 9 years ago

…o add their own trace value transformation or masking logic via custom attributes.

The main intent here is to provide a mechanism for masking PII data in our logs but this could be used for other purposes.

jonwagner commented 9 years ago

a) I think you could achieve the same thing by using the configuration methods (see below) b) Of course, it would be nice if you could do that with attributes for consistency sake, so I think adding a TraceTransformAttribute works well. c) I'll make you a build if you update the wiki. :)

TraceParameterProvider.Default .For() .With() .Ignore("number") .Trace(c => c.Number.Last4Digits()) .As("maskednumber");

JerretK commented 9 years ago

This was an approach I considered but:

1) If you have a lot of interfaces defined with various names then you're looking at quite a few fluent statements to get everything wired up. 2) As you mentioned there's a consistency issue where it's difficult to determine whether we're applying a particular transform to trace members without correlating the interface definition alongside the configuration methods.

So, I guess this is technically supported but not as maintainable as desired?

If you're still willing I would be happy to update the wiki if you can pull this in!

Thanks

jonwagner commented 9 years ago

I'm agreeing with you. :)

I can do a build when i get to my other computer.

On Jun 18, 2015, at 2:26 PM, Jerret Kinsman notifications@github.com wrote:

This was an approach I considered but:

1) If you have a lot of interfaces defined with various names then you're looking at quite a few fluent statements to get everything wired up. 2) As you mentioned there's a consistency issue where it's difficult to determine whether we're applying a particular transform to trace members without correlating the interface definition alongside the configuration methods.

So, I guess this is technically supported but not as maintainable as desired?

If you're still willing I would be happy to update the wiki if you can pull this in!

Thanks

— Reply to this email directly or view it on GitHub.

JerretK commented 9 years ago

Hi Jon, I've added a snippet to the wiki illustrating how to use the TraceTransformAttribute. I added this under the Controlling Logged Data section. Let me know if there are any changes you would like to see.

Best, Jerret

jonwagner commented 9 years ago

Merged into v3.0.7 and pushed to nuget. Thanks for the help.

JerretK commented 9 years ago

Excellent, thanks!