Exemple #1
0
        public RemoteLogger(string name, RemoteLoggerSetting setting, HttpClient httpClient = null)
        {
            _httpClient = httpClient ?? new HttpClient()
            {
                BaseAddress = new Uri(setting.RemoteUrl)
            };

            _name    = name;
            _setting = setting;

            Application = setting.Application;
            Service     = setting.Service;
            Environment = setting.Environment;
        }
Exemple #2
0
        public RemoteLogger(string name, HttpClient httpClient, string application, string service, string environment, LogLevel minEventLevel)
        {
            _name       = name;
            _httpClient = httpClient;

            Application = application;
            Service     = service;
            Environment = environment;

            _setting = new RemoteLoggerSetting
            {
                IsEnabled     = true,
                MinEventLevel = minEventLevel,
                RemoteUrl     = httpClient.BaseAddress.ToString()
            };
        }
Exemple #3
0
        public RemoteLogger(string name, string remoteUrl, string application, string service, string environment, LogLevel minEventLevel)
        {
            _name       = name;
            _httpClient = new HttpClient()
            {
                BaseAddress = new Uri(remoteUrl)
            };

            Application = application;
            Service     = service;
            Environment = environment;

            _setting = new RemoteLoggerSetting
            {
                IsEnabled     = true,
                MinEventLevel = minEventLevel,
                RemoteUrl     = remoteUrl
            };
        }
 public RemoteLoggerProvider(RemoteLoggerSetting config, HttpClient httpClient = null)
 {
     _config     = config;
     _httpClient = httpClient;
 }
 public static ILoggerFactory AddRemoteLogger(this ILoggerFactory loggerFactory, RemoteLoggerSetting config, HttpClient httpClient = null)
 {
     loggerFactory.AddProvider(new RemoteLoggerProvider(config, httpClient));
     return(loggerFactory);
 }