Ejemplo n.º 1
0
        public void LogException(Exception exception)
        {
            if (database == null)
            {
                return;
            }

            ErrorLogEntry error = new ErrorLogEntry();

            var exceptionStackTrace = new ExceptionStackTrace(exception);

            error.CommandLine         = Environment.CommandLine;
            error.ExceptionMessage    = exceptionStackTrace.Message;
            error.ExceptionType       = exception.GetType().FullName;
            error.ExceptionSource     = exceptionStackTrace.Source;
            error.ExceptionStackTrace = exceptionStackTrace.StackTrace;
            error.FileName            = exceptionStackTrace.FileName;
            error.HostName            = System.Environment.MachineName;
            error.IPAddress           = Utils.GetLocalIP().GetAddressBytes();
            error.LineNumber          = exceptionStackTrace.LineNumber;
            error.ProcessID           = Process.GetCurrentProcess().Id;
            error.TestID = database.GetCurrentTestID();

            database.LogError(error);
        }
Ejemplo n.º 2
0
        public Int64 LogError(ErrorLogEntry error)
        {
            var query = error.Query + ";" + scopedIdentityQuery;

            using (SqlCommand command = new SqlCommand(query, connection))
            {
                foreach (var param in error.Parameters)
                {
                    command.Parameters.Add(param);
                }
                return((Int64)command.ExecuteScalar());
            }
        }
Ejemplo n.º 3
0
        public void LogException(Exception exception)
        {
            if (database == null)
                return;

            ErrorLogEntry error = new ErrorLogEntry();

            var exceptionStackTrace = new ExceptionStackTrace(exception);

            error.CommandLine = Environment.CommandLine;
            error.ExceptionMessage = exceptionStackTrace.Message;
            error.ExceptionType = exception.GetType().FullName;
            error.ExceptionSource = exceptionStackTrace.Source;
            error.ExceptionStackTrace = exceptionStackTrace.StackTrace;
            error.FileName = exceptionStackTrace.FileName;
            error.HostName = System.Environment.MachineName;
            error.IPAddress = Utils.GetLocalIP().GetAddressBytes();
            error.LineNumber = exceptionStackTrace.LineNumber;
            error.ProcessID = Process.GetCurrentProcess().Id;
            error.TestID = database.GetCurrentTestID();

            database.LogError(error);
        }