Example #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
                });
            }
        }
Example #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
            });
        }
 public string StackTraceSnippetGet() => StackTraceSnippet.Get(Options);
 public string StackTraceSnippetGet() => StackTraceSnippet.Get();