public SqliteLogger(string categoryName, IDML dml, IConfiguration configuration = null) : base(categoryName, configuration) { this.categoryName = categoryName; this.repository = dml; workQueue = new WorkQueue <LogInfo>(1000, (s, e) => { lock (dml)//这里要锁实际调用的logService。 { dml.Add(e.Item.ToArray()); dml.SaveChanges(); } }); }
public SqliteLoggerProvider(IDML dml, IConfiguration configuration = null) { this.dml = dml; this.configuration = configuration; }