예제 #1
0
 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();
         }
     });
 }
예제 #2
0
 public SqliteLoggerProvider(IDML dml, IConfiguration configuration = null)
 {
     this.dml           = dml;
     this.configuration = configuration;
 }