public void CreateLogSettings() { Logger.LogInformationMessage("Creating counter set name {0}", new object[] { this.counterSetName }); DataCollectorSet dataCollectorSet = this.ConstructDataCollectorSet(); try { if (dataCollectorSet.Status != null) { dataCollectorSet.Stop(true); dataCollectorSet.Delete(); } } catch (Exception) { } dataCollectorSet.Commit(this.counterSetName, null, 3); }
public void DeleteLogSettings() { if (this.Status != PerformanceLogSet.PerformanceLogSetStatus.DoesNotExist) { try { this.StopLog(true); Logger.LogInformationMessage("Deleting counter set name {0}", new object[] { this.counterSetName }); DataCollectorSet dataCollectorSet = this.ConstructDataCollectorSet(); dataCollectorSet.Delete(); } catch (COMException ex) { if (-2144337918 != ex.ErrorCode) { throw; } } } }