예제 #1
0
        public void ExecuteFinish(IDbCommand command, SqlExecuteType type, DbDataReader reader)
        {
            DbCommandKey id = Tuple.Create((object)command, type);

            if (_inProgress.TryRemove(id, out Stopwatch stopwatch) && stopwatch.Elapsed > _threshold)
            {
                _logger.Warn("{LongRunningQuery}", new
                {
                    stackTrace = StackTraceSnippet.Get(Options),
                    sql        = command.CommandText,
                    elapsed    = (long)stopwatch.Elapsed.TotalMilliseconds
                });
            }
        }
예제 #2
0
        public static void WriteMessage(string message)
        {
            if (!IsSendToNetwork)
            {
                return;
            }

            StackFrame stackFrame;
            string     stackTrace = StackTraceSnippet.Get(out stackFrame);

            ThreadPool.QueueUserWorkItem(WriteMessageInThread, new ThreadInfoLogCommand
            {
                StackFrame        = stackFrame,
                Message           = message,
                StackTraceSnippet = stackTrace
            });
        }
예제 #3
0
 public string StackTraceSnippetGet() => StackTraceSnippet.Get(Options);
 public string StackTraceSnippetGet() => StackTraceSnippet.Get();