/// <summary> /// Flushes any items in the queue when shutting down an app /// </summary> public static void Shutdown() { //flush logs queue _LogClient.Close(); //flush any remaining metrics as well MetricClient.StopMetricsQueue("Logger Shutdown called"); }
protected override void OnClose() { try { _logClient.Close(); StackifyLib.Internal.Metrics.MetricClient.StopMetricsQueue("log4net v1.2 OnClose"); } catch { } }
protected override void CloseTarget() { try { StackifyLib.Utils.StackifyAPILogger.Log("NLog target closing"); _logClient.Close(); StackifyLib.Internal.Metrics.MetricClient.StopMetricsQueue("NLog CloseTarget"); } catch (Exception ex) { StackifyLib.Utils.StackifyAPILogger.Log("NLog target closing error: " + ex.ToString()); } }
public void Dispose() { if (_disposed) { return; } try { StackifyLib.Utils.StackifyAPILogger.Log("Serilog target closing"); _logClient.Close(); StackifyLib.Internal.Metrics.MetricClient.StopMetricsQueue("Serilog CloseTarget"); } catch (Exception ex) { StackifyLib.Utils.StackifyAPILogger.Log("Serilog target closing error: " + ex.ToString()); } _disposed = true; }