コード例 #1
0
        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}");
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void Add(T logObject)
 {
     _queuedLogItemHandler.Add(logObject);
 }