public ServiceMonitoringLogger(string name, ServiceMonitoringLoggerConfig config, HttpClient httpClient, Func <string, LogLevel, bool> filter = null, ILogger fallbackLogger = null)
 {
     this.name           = name;
     this.fallbackLogger = fallbackLogger;
     this.config         = config;
     this.httpClient     = httpClient;
     Filter = filter ?? ((category, logLevel) => true);
 }
Exemple #2
0
        private Func <string, LogLevel, bool> GetFilter(string name, ServiceMonitoringLoggerConfig settings)
        {
            if (settings != null)
            {
                foreach (var prefix in GetKeyPrefixes(name))
                {
                    if (settings.TryGetSwitch(prefix, out var level))
                    {
                        return((n, l) => l >= level);
                    }
                }
            }

            return((cat, level) => false);
        }
Exemple #3
0
 public ServiceMonitoringLoggerProvider(ServiceMonitoringLoggerConfig config, HttpClient httpClient, ILoggerProvider fallbackLoggerProvider)
 {
     this.config                 = config;
     this.httpClient             = httpClient;
     this.fallbackLoggerProvider = fallbackLoggerProvider;
 }
Exemple #4
0
 public ServiceMonitoringLoggerProvider(ServiceMonitoringLoggerConfig config, HttpClient httpClient)
 {
     this.config     = config;
     this.httpClient = httpClient;
 }