Here you can find the source of logException(Throwable t, Logger log, Level level)
public static void logException(Throwable t, Logger log, Level level)
//package com.java2s; //License from project: Open Source License import java.io.PrintWriter; import java.io.StringWriter; import java.util.logging.Level; import java.util.logging.Logger; public class Main { public static void logException(Throwable t, Logger log, Level level) { String msg = t.getMessage() + "\n" + backtraceToString(t); log.log(level, msg);/*from w w w .ja va 2 s . c o m*/ } public static String backtraceToString(Throwable t) { StringWriter sw = new StringWriter(); t.printStackTrace(new PrintWriter(sw)); return sw.toString(); } }