How to exclude a class member from logging?

Answered How to exclude a class member from logging?

  • Saturday, April 21, 2012 9:02 PM
     
     

    Is it possible to configure AVICode to exclude certain class members from logging? For example, consider the following class:

    public class CreditCard{
      public int Id {get;set;}
      public string NameOnCard { get; set;}
      public string CardNumber {get;set;}
    }

    In this type of scenario, the CardNumber contains sensitive data that should not be persisted in other locations (AVICode database), however Id and Name are important for troubleshooting and debugging.

All Replies

  • Sunday, April 22, 2012 4:11 PM
     
     Answered

    You have "sensitive data rules" to mask out values of some parameters:

    There is a difference, however: in AVIcode 5.7, the filter is applied server-side (which means the sensitive data is still TRANSMITTED To the server), while in OM12 the logic has been moved to the Agent, so the filtering happens directly BEFORE sending the data.


  • Tuesday, April 24, 2012 12:58 PM
     
      Has Code

    Hi guys,

    There is another approach how to restrict class members collection even on Agent side. In "PMonitor2_0.default.config" you can specify rules for your custom class collection by pointing explicit members you want to grab (you just don't add CardNumber field there):

    <ss:classes>
    ...
          <ss:class name="ClassMembers.CreditCard">
            <ss:member name="Id"/>
            <ss:member name="NameOnCard"/>
          </ss:class>
     </ss:classes>

    Here is what I get in my case (you see no CardNumber parameter collected):

    The same is applied on exception events:


    Igor Savchenko, VIAcode Consulting LLC (http://www.viacode.com/solutions)

  • Tuesday, April 24, 2012 1:18 PM
     
     
    Thanks for the solutions - both will do the trick though in my scenario I'd rather explicitly opt-out certain fields rather than manually opt-in members of classes.