Пример #1
0
 private void SetLoggerInformation(ref LoggerInformation loggerInformation, ILoggerProvider provider, string categoryName)
 {
     loggerInformation.Logger        = provider.CreateLogger(categoryName);
     loggerInformation.ProviderType  = provider.GetType();
     loggerInformation.ExternalScope = provider is ISupportExternalScope;
     //loggerInformation.Rule = LoggerFilterRule.CreateDefault();
 }
Пример #2
0
 private void SetLoggerInformation(ref LoggerInformation loggerInformation, ILoggerProvider provider, string categoryName)
 {
     loggerInformation.Logger        = provider.CreateLogger(categoryName);
     loggerInformation.ProviderType  = provider.GetType();
     loggerInformation.ExternalScope = provider is ISupportExternalScope;
     loggerInformation.LogType       = LogType.HttpContext;
 }
Пример #3
0
 private LoggerInformation[] CreateLoggers(string categoryName)
 {
     LoggerInformation[] loggers = new LoggerInformation[this._providerRegistrations.Count];
     for (int i = 0; i < this._providerRegistrations.Count; i++)
     {
         this.SetLoggerInformation(ref loggers[i], this._providerRegistrations[i].Provider, categoryName);
     }
     this.ApplyRules(loggers, categoryName, 0, loggers.Length);
     return(loggers);
 }
Пример #4
0
 private void ApplyRules(LoggerInformation[] loggers, string categoryName, int start, int count)
 {
     for (int index = start; index < start + count; index++)
     {
         ref LoggerInformation loggerInformation = ref loggers[index];
         LogType  logType;
         LogLevel?minLevel;
         int      traceCount;
         Func <string, string, LogLevel, bool> filter;
         LoggerFactory.RuleSelector.Select(LoggerFactory._filterOptions, loggerInformation.ProviderType, categoryName, out logType, out minLevel, out traceCount, out filter);
         loggerInformation.Rule            = new LoggerFilterRule("Logging", categoryName, minLevel, filter);
         loggerInformation.Rule.LogType    = logType;
         loggerInformation.Filter          = filter;
         loggerInformation.Rule.TraceCount = traceCount;
     }