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
You have "sensitive data rules" to mask out values of some parameters:
- In OpsMgr 2012 APM, the procedure is documented here http://technet.microsoft.com/library/hh543995.aspx
- In AVIcode 5.x I believe it is described in the CHM help file in the "Advanced Configuration" chapter - search for "sensitive" or "hidden".
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.
- Edited by Daniele MuscettaMicrosoft Employee Sunday, April 22, 2012 4:12 PM added hyperlink
- Marked As Answer by steveberkovitz Tuesday, April 24, 2012 1:17 PM
-
Tuesday, April 24, 2012 12:58 PM
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 PMThanks 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.

