private void Add(MainLogItem logItem) { _queuedLogItemHandler.Add(logItem); try { NewLogItem?.Invoke(this, new MainLogItemEventArgs(logItem)); } catch (Exception exception) { Debug.WriteLine($"EXCEPTION IN {nameof(MainLog)}: {exception}"); } }
public void Add(Func <string> getMessage, [System.Runtime.CompilerServices.CallerFilePath] string callerFilePath = null) { if (!_isActive()) { return; } var logItem = new TelemetryLogItem( DateTime.UtcNow, LogLevel.Info, getMessage(), callerFilePath); _queuedLogItemHandler.Add(logItem); }
public void Add( HttpMethod requestHttpMethod, string requestRawUrl, string requestUserAgent, string requestRemoteEndPointAddress, long responseTimeInMs, long requestContentLength, long responseLengthInBytes, int statusCode) { var logItem = new HttpLogItem( DateTime.UtcNow, LogLevel.Info, requestHttpMethod, requestRawUrl, requestUserAgent, requestRemoteEndPointAddress, statusCode, requestContentLength, responseLengthInBytes, responseTimeInMs); _queuedLogItemHandler.Add(logItem); }
public void Add(T logObject) { _queuedLogItemHandler.Add(logObject); }