public ErrorEvent LogException(OperationContext context, int contactID, Exception exception, string comments)
        {
            String     message    = null;
            String     stackTrace = null;
            ErrorEvent errorEvent = null;

            try
            {
                //Consolidate message and stackTraces of the exception and any/all of its inner exceptions.
                Util.ExceptionUtil.BuildStrings(exception, out message, out stackTrace);

                if (exception != null)
                {
                    errorEvent = CreateErrorEvent(context, contactID, message, stackTrace, comments, true);
                }
                else
                {
                    errorEvent = CreateErrorEvent(context, contactID, null, null, comments, true);
                }
                ErrorEventDbUtil.Write(errorEvent);
            }
            catch (Exception ex)
            {
                String ip     = null;
                String source = "svc";
                try
                {
                    ip     = GetHostName();
                    source = GetSource(context);
                }
                catch { }
                ExceptionUtil.HandleLoggingException(ex, contactID, source, ip, false);
            }
            return(errorEvent);
        }
Esempio n. 2
0
        public ErrorEvent LogException(int contactID, string source, Exception exception, string comments)
        {
            String     message    = null;
            String     stackTrace = null;
            ErrorEvent errorEvent = null;

            try
            {
                //Consolidate message and stackTraces of the exception and any/all of its inner exceptions.
                Util.ExceptionUtil.BuildStrings(exception, out message, out stackTrace);

                if (exception != null)
                {
                    errorEvent = CreateErrorEvent(contactID, source, message, stackTrace, comments);
                }
                else
                {
                    errorEvent = CreateErrorEvent(contactID, source, null, null, comments);
                }
                ErrorEventDbUtil.Write(errorEvent);
            }
            catch (Exception ex)
            {
                ExceptionUtil.HandleLoggingException(ex, contactID, source, null, false);
            }
            return(errorEvent);
        }
Esempio n. 3
0
        public ErrorEvent LogMessage(int contactID, string source, string message, string comments)
        {
            ErrorEvent errorEvent = null;

            try
            {
                errorEvent = CreateErrorEvent(contactID, source, message, null, comments);
                ErrorEventDbUtil.Write(errorEvent);
            }
            catch (Exception ex)
            {
                ExceptionUtil.HandleLoggingException(ex, contactID, source, null, false);
            }
            return(errorEvent);
        }
        public ErrorEvent LogMessage(OperationContext context, int contactID, string message, string comments)
        {
            ErrorEvent errorEvent = null;

            try
            {
                errorEvent = CreateErrorEvent(context, contactID, message, null, comments, false);
                ErrorEventDbUtil.Write(errorEvent);
            }
            catch (Exception ex)
            {
                String ip     = null;
                String source = "svc";
                try
                {
                    ip     = GetHostName();
                    source = GetSource(context);
                }
                catch { }
                ExceptionUtil.HandleLoggingException(ex, contactID, source, ip, false);
            }
            return(errorEvent);
        }