private void WriteEventToDatabase(LogDetails details)
 {
     using (IDocumentSession session = _store.OpenSession(DatabaseName))
     {
         session.Store(details);
         session.SaveChanges();
     }
 }
 protected override void Write(LogEventInfo logEvent)
 {
     var details = new LogDetails(logEvent);
     try
     {
         WriteEventToDatabase(details);
     }
     catch (Exception ex)
     {
         if (ex.MustBeRethrown())
         {
             throw;
         }
         InternalLogger.Error("Error when writing to database {0}", new object[] {ex});
         throw;
     }
 }
 private void WriteEventToDatabase(LogDetails details)
 {
     WriteEvent(details);
 }
 private void WriteEvent(LogDetails details)
 {
     MongoCollection<LogDetails> logEventInfos = _database.GetCollection<LogDetails>("logdetails");
     logEventInfos.Insert(details);
 }