Exemplo n.º 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;
        }
Exemplo n.º 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()
            };
        }
Exemplo n.º 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
            };
        }
Exemplo n.º 4
0
 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);
 }