Exemple #1
0
 protected static void CopyProperties(IActivityScope source, Dictionary <string, object> target, IEnumerable <KeyValuePair <Enum, string> > enumToKeyMappings)
 {
     foreach (KeyValuePair <Enum, string> keyValuePair in enumToKeyMappings)
     {
         ExtensibleLogger.CopyProperty(source, target, keyValuePair.Key, keyValuePair.Value, false);
     }
 }
Exemple #2
0
        private static void CopyProperty(IActivityScope source, Dictionary <string, object> target, Enum sourceKey, string targetKey, bool isPII)
        {
            string property = source.GetProperty(sourceKey);

            if (property == null)
            {
                return;
            }
            if (target.ContainsKey(targetKey))
            {
                throw new ArgumentException(string.Format("targetKey '{0}' is already being used by another property: {1}", targetKey, sourceKey));
            }
            target.Add(targetKey, isPII ? ExtensibleLogger.FormatPIIValue(property) : property);
        }
Exemple #3
0
 protected static void CopyProperty(IActivityScope source, Dictionary <string, object> target, Enum sourceKey, string targetKey)
 {
     ExtensibleLogger.CopyProperty(source, target, sourceKey, targetKey, false);
 }