protected void log(int type, Object message, Throwable t) {
        // Use a string buffer for better performance
        StringBuffer buf = new StringBuffer();

        // Append date-time if so configured
        if (showDateTime) {
            buf.append(dateFormatter.format(new Date()));
            buf.append(" ");
        }

        // Append a readable representation of the log level
        switch (type) {
        case SimpleLog.LOG_LEVEL_TRACE:
            buf.append("[TRACE] ");
            break;
        case SimpleLog.LOG_LEVEL_DEBUG:
            buf.append("[DEBUG] ");
            break;
        case SimpleLog.LOG_LEVEL_INFO:
            buf.append("[INFO] ");
            break;
        case SimpleLog.LOG_LEVEL_WARN:
            buf.append("[WARN] ");
            break;
        case SimpleLog.LOG_LEVEL_ERROR:
            buf.append("[ERROR] ");
            break;
        case SimpleLog.LOG_LEVEL_FATAL:
            buf.append("[FATAL] ");
            break;
        }

        // Append the name of the log instance if so configured
        if (showShortName) {
            if (shortLogName == null) {
                // Cut all but the last component of the name for both styles
                shortLogName = logName.substring(logName.lastIndexOf(".") + 1);
                shortLogName = shortLogName.substring(shortLogName.lastIndexOf("/") + 1);
            }
            buf.append(String.valueOf(shortLogName)).append(" - ");
        } else if (showLogName) {
            buf.append(String.valueOf(logName)).append(" - ");
        }

        // Append the message
        buf.append(String.valueOf(message));

        // Append stack trace if not null
        if (t != null) {
            buf.append(" <");
            buf.append(t.toString());
            buf.append(">");

            java.io.StringWriter sw = new java.io.StringWriter(1024);
            java.io.PrintWriter pw = new java.io.PrintWriter(sw);
            t.printStackTrace(pw);
            pw.close();
            buf.append(sw.toString());
        }

        // Print to the appropriate destination
        write(buf);

    }
<p>
Do the actual logging. This method assembles the message and then calls
<code>write()</code> to cause it to be written.


@param type
         One of the LOG_LEVEL_XXX constants defining the log level
@param message
         The message itself (typically a String)
@param t
         The exception whose stack trace should be logged
jcl-over-slf4j/src/main/java/org/apache/commons/logging/impl/SimpleLog.java