public SejilService(ISejilSettings settings) { _connectionString = settings.ConnectionString; _settings = settings; //InitializeDatabase(); }
public SejilSink(ISejilSettings settings) : base(_defaultBatchSizeLimit, _defaultBatchEmitPeriod) { _connectionString = $"DataSource={settings.SqliteDbPath}"; _uri = settings.Url; InitializeDatabase(); }
/// <summary> /// Adds Sejil services. /// </summary> /// <param name="builder">The web host builder.</param> /// <param name="url">The URL at which Sejil should be available.</param> /// <param name="minLogLevel">The minimum log level.</param> /// <returns></returns> public static IWebHostBuilder AddSejil(this IWebHostBuilder builder, ISejilSettings settings) { return(builder //.ConfigureLogging((logging) => logging.AddSerilog(CreateLogger(settings))) .ConfigureServices(services => { services.TryAddSingleton <IHttpContextAccessor, HttpContextAccessor>(); services.AddSingleton(settings); services.AddScoped <ISejilRepository, SejilRepository>(); services.AddScoped <ISejilSqlProvider, SejilSqlProvider>(); services.AddScoped <ISejilController, SejilController>(); })); }
public static LoggerConfiguration Sejil( this LoggerSinkConfiguration loggerConfiguration, ISejilSettings settings, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { try { var sqliteDbFile = new FileInfo(settings.SqliteDbPath); sqliteDbFile.Directory.Create(); return(loggerConfiguration.Sink( new SejilSink(settings), restrictedToMinimumLevel)); } catch (Exception ex) { SelfLog.WriteLine(ex.Message); throw; } }
public SejilController(IHttpContextAccessor contextAccessor, ISejilRepository repository, ISejilSettings settings) => (_context, _repository, _settings) = (contextAccessor.HttpContext, repository, settings);
public SejilSqlProvider(ISejilSettings settings) { _nonPropertyColumns = settings.NonPropertyColumns; }
public SejilSinkMock(ISejilSettings settings) : base(settings) { }
private ISejilController CreateController(HttpContext context, ISejilRepository repository, ISejilSettings settings) => new SejilController(new HttpContextAccessor { HttpContext = context }, repository, settings);
public SejilController(IHttpContextAccessor contextAccessor, ISejilRepository repository, ISejilSettings settings) { _context = contextAccessor.HttpContext; _repository = repository; _settings = settings; }
public SejilSink(ISejilSettings settings) : base(_defaultBatchSizeLimit, _defaultBatchEmitPeriod) { _settings = settings; }
private static Serilog.Core.Logger CreateLogger(ISejilSettings settings) => new LoggerConfiguration() .Enrich.FromLogContext() .MinimumLevel.ControlledBy(settings.LoggingLevelSwitch) .WriteTo.Sejil(settings) .CreateLogger();
public SejilSqlProvider(ISejilSettings settings) => _settings = settings;
public SejilCleanupService(ISejilSettings settings, SejilService sejilService) { _connectionString = settings.ConnectionString; _sejilService = sejilService; //InitializeDatabase(); }
public SejilRepository(ISejilSqlProvider sql, ISejilSettings settings) { _sql = sql; _connectionString = settings.ConnectionString; _pageSize = settings.PageSize; }
public SejilRepository(ISejilSqlProvider sql, ISejilSettings settings) { _sql = sql; _connectionString = $"DataSource={settings.SqliteDbPath}"; _pageSize = settings.PageSize; }