Exemplo n.º 1
0
        /// <summary>
        /// Builds the dispatcher using the provided configuration and optional exception handler
        /// </summary>
        /// <param name="initialConfig">The initial configuration to use to build the dispatcher</param>
        /// <param name="exceptionHandler">The exception handler to use for the dispatcher</param>
        public LogEventDispatcher(LoggingConfig initialConfig, Action<Exception, string> exceptionHandler = null)
        {
            ExceptionHandler = exceptionHandler;

            TagKeeper = new TagKeeper();
            TargetKeeper = new TargetKeeper(this);
            RuleKeeper = new RuleKeeper(TagKeeper);
            TargetCache = new Dictionary<string, ICollection<TargetBase>>();

            ActionQueue = new ConcurrentQueue<Action>();
            LogQueue = new ConcurrentQueue<LogEvent>();

            // Wire up the configuration
            NewConfig(initialConfig);
        }
Exemplo n.º 2
0
 /// <summary>
 /// The default constructor
 /// </summary>
 /// <param name="tagKeeper">The tag keeper to use in determining tag matches</param>
 public RuleKeeper(TagKeeper tagKeeper)
 {
     TagKeeper = tagKeeper;
     _routeCache = new Dictionary<string, ICollection<string>>();
     _routeKeyCache = new Queue<string>();
 }