Beispiel #1
0
 private void Archive()
 {
     if (_LogMarshal.LogCount > _LogSettings.AutoArchiveMaximumLogs)
     {
         _LogStats.LastArchiveCount = Logging.LoggingHelper.ArchiveLogs(_LogMarshal,
                                                                        _ArchiveFileStore,
                                                                        _ArchiveFilenameFactory.GenerateFilename,
                                                                        _LogSettings.WriteArchivedLogEntriesUsingLocalTime,
                                                                        _LogSettings.TruncateLogArchive,
                                                                        _LogSettings.TruncateLogArchiveMaximumFiles,
                                                                        _LogSettings.TruncateLogArchivePercentageToRemove);
         if (_LogStats.LastArchiveCount > _LogStats.LargestArchiveCount)
         {
             _LogStats.LargestArchiveCount = _LogStats.LastArchiveCount;
         }
         _LogMarshal.Clear();
         _LogStats.LastArchiveDate = DateTime.Now;
         ++_LogStats.ArchiveGeneration;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Will remove all log entries.
 /// </summary>
 /// <param name="includeArchivedLogs"><b>True</b> will clear all archived logs; otherwise, <b>false</b> will leave the archived logs alone.</param>
 public void Clear(bool includeArchivedLogs)
 {
     LogMarshal.Clear();
     _LogArchiveFileStore.Clear();
     _LogArchiveFileStore.Save(false);
 }