Exemplo n.º 1
0
 public ESLogger(ESClientProvider esClient, IHttpContextAccessor httpContextAccessor, string categoryName, LogLevel logLevel)
 {
     _esClient            = esClient;
     _httpContextAccessor = httpContextAccessor;
     _categoryName        = categoryName;
     _logLevel            = logLevel;
 }
        public ESLoggerProvider(IServiceProvider serviceProvider)
        {
            _httpContextAccessor = serviceProvider.GetService <IHttpContextAccessor>();

            _esClient = serviceProvider.GetService <ESClientProvider>();
            _esClient.EnsureIndexWithMapping <LogEntry>();

            _filter = new FilterLoggerSettings
            {
                { "*", _esClient.LogLevel }
            };
        }