Esempio n. 1
0
            public void MapLoggersToDistributionGroup(LoggerNameMatchType matchType, string matchStr, string groupName)
            {
                lock (distMutex)
                {
                    int dgid = InnerGetDistGroupID(groupName, true);

                    if (!InnerIsDistGroupIDValid(dgid))
                    {
                        Utils.Asserts.TakeBreakpointAfterFault("MapLoggersToDistributionGroup::Given GroupName could not be created.");
                        return;
                    }

                    PerDistGroupIDInfo dgInfo = distGroupIDInfoList [dgid];

                    dgInfo.loggerNameMatchType = matchType;
                    dgInfo.loggerNameMatchStr = matchStr;
                    if (matchType == LoggerNameMatchType.Regex)
                    {
                        try
                        {
                            dgInfo.loggerNameMatchRegex = new System.Text.RegularExpressions.Regex(matchStr);
                        }
                        catch (System.Exception ex)
                        {
                            Utils.Asserts.LogFaultOccurance(Utils.Fcns.CheckedFormat("MapLoggersToDistributionGroup grp:{0}, regex:{1} failed", groupName, matchStr), ex);
                        }
                    }

                    InnerRemapLoggersToDistGroups();
                }
            }
Esempio n. 2
0
 /// <summary>(re)Maps the selected loggers to the given group name.  Loggers must have initially placed themselves in the LookupDistributionGroupName group in order to support being mapped.</summary>
 public static void MapLoggersToDistributionGroup(LoggerNameMatchType matchType, string matchStr, string groupName)
 {
     GetLogMessageDistributionImpl().MapLoggersToDistributionGroup(matchType, matchStr, groupName);
 }