private static void LogException(OMEException oEx) { string traceInfo = null; if (oEx.traceInfo == StackTraceType.ENHANCED) { //StackTrace st = new StackTrace(true); //traceInfo = OMEStackTrace.EnhancedStackTrace(st); traceInfo = OMEStackTrace.EnhancedStackTrace(oEx.StackTrace); } else if (oEx.traceInfo == StackTraceType.BRIEF) { StackTrace st = new StackTrace(true); traceInfo = OMEStackTrace.BriefStackTrace(st, 0); //ilaevel is stack Frame } string traceMessage = oEx.ErrorCode; if (oEx.innerException != null) { traceMessage += Environment.NewLine + oEx.innerException; } traceMessage += Environment.NewLine + traceInfo; lock (m_syncLock) { m_Logger.Write(traceMessage); } }
private static void LogException(Exception oEx) { string traceInfo = null; //string systemErrorCode = "SYS001"; //StackTrace st = new StackTrace(true); //traceInfo = OMEStackTrace.EnhancedStackTrace(st); traceInfo = OMEStackTrace.EnhancedStackTrace(oEx.StackTrace); string traceMessage = LoggingConstants.EXCEPTION_SYSTEM_ERROR + Environment.NewLine + oEx.Message; if (oEx.InnerException != null) { traceMessage += Environment.NewLine + oEx.InnerException.Message; } traceMessage += Environment.NewLine + traceInfo; lock (m_syncLock) { m_Logger.Write(traceMessage); } }