mil.dod.th.ose.logging/src/mil/dod/th/ose/logging/LogUtil.java
private static void addExceptionTrace(final Throwable except, final StringBuilder stringBuilder)
    {
        stringBuilder.append("Caused by: ");

        final Class<?> exceptClass = except.getClass();
        if (exceptClass == null)
        {
            stringBuilder.append("*Unknown Exception*");
        }
        else
        {
            stringBuilder.append(exceptClass.getName());
        }

        final String exceptionMessage = except.getMessage();
        if (exceptionMessage != null)
        {
            stringBuilder.append(": ");
            stringBuilder.append(exceptionMessage);
        }

        stringBuilder.append('\n');
        final int maxTraceSize = 15;
        for (int i = 0; i < except.getStackTrace().length && i < maxTraceSize; i++)
        {
            final StackTraceElement element = except.getStackTrace()[i];
            stringBuilder.append("    at ");
            stringBuilder.append(element.toString());
            stringBuilder.append('\n');
        }
        
        if (except.getStackTrace().length > maxTraceSize)
        {
            stringBuilder.append("    ... ");
            stringBuilder.append(except.getStackTrace().length - maxTraceSize);
            stringBuilder.append(" more\n");
        }
    }
/**
     * Creates an exception trace using the given {@link StringBuilder} reference.
     *
     * @param except
     *            Exception being logged.
     * @param stringBuilder
     *            String builder used in creating the log message.
     */
Creates an exception trace using the given  StringBuilder reference.
@param except
Exception being logged.
@param stringBuilder
String builder used in creating the log message.
Creates an exception trace using the given StringBuilder reference . @param except Exception being logged . @param stringBuilder String builder used in creating the log message .
private static void addExceptionTrace(final Throwable except, final StringBuilder stringBuilder)
    {
        stringBuilder.append("Caused by: ");
        final Class<?> exceptClass = except.getClass();
        if (exceptClass == null)
        {
            stringBuilder.append("*Unknown Exception*");
        }
        else
        {
            stringBuilder.append(exceptClass.getName());
        }
        final String exceptionMessage = except.getMessage();
        if (exceptionMessage != null)
        {
            stringBuilder.append(": ");
            stringBuilder.append(exceptionMessage);
        }
        stringBuilder.append('\n');
        final int maxTraceSize = 15;
        for (int i = 0; i < except.getStackTrace().length && i < maxTraceSize; i++)
        {
            final StackTraceElement element = except.getStackTrace()[i];
            stringBuilder.append("    at ");
            stringBuilder.append(element.toString());
            stringBuilder.append('\n');
        }
        if (except.getStackTrace().length > maxTraceSize)
        {
            stringBuilder.append("    ... ");
            stringBuilder.append(except.getStackTrace().length - maxTraceSize);
            stringBuilder.append(" more\n");
        }
    }
private static void addExceptionTrace ( final Throwable except , final StringBuilder stringBuilder ) { stringBuilder . append ( "Caused by: " ) ; final Class < ? > exceptClass = except . getClass ( ) ; if ( exceptClass == null ) { stringBuilder . append ( "*Unknown Exception*" ) ; } else { stringBuilder . append ( exceptClass . getName ( ) ) ; } final String exceptionMessage = except . getMessage ( ) ; if ( exceptionMessage != null ) { stringBuilder . append ( ": " ) ; stringBuilder . append ( exceptionMessage ) ; } stringBuilder . append ( '\n' ) ; final int maxTraceSize = 15 ; for ( int i = 0 ; i < except . getStackTrace ( ) . length && i < maxTraceSize ; i ++ ) { final StackTraceElement element = except . getStackTrace ( ) [ i ] ; stringBuilder . append ( "    at " ) ; stringBuilder . append ( element . toString ( ) ) ; stringBuilder . append ( '\n' ) ; } if ( except . getStackTrace ( ) . length > maxTraceSize ) { stringBuilder . append ( "    ... " ) ; stringBuilder . append ( except . getStackTrace ( ) . length - maxTraceSize ) ; stringBuilder . append ( " more\n" ) ; } }
Creates an exception trace using the given {@link StringBuilder} reference.
Creates an exception trace using the given { @link StringBuilder } reference .