Java Utililty Methods Log Exception

List of utility methods to do Log Exception

Description

The list of methods to do Log Exception are organized into topic(s).

Method

voidlogException(String msg, Exception ex)
Logs the specified message and exception to ./repast.log.
BufferedWriter out;
PrintWriter pOut = null;
try {
    out = new BufferedWriter(new FileWriter("./repast.log"));
    pOut = new PrintWriter(out);
    pOut.println(msg);
    ex.printStackTrace(pOut);
    pOut.flush();
...
voidlogException(Throwable t, Logger log, Level level)
log Exception
String msg = t.getMessage() + "\n" + backtraceToString(t);
log.log(level, msg);
voidlogStackTrace(Logger log, Throwable e)
Logs an entire stack trace to the logger, so that it can easily be viewed in the App Engine log.
logStackTrace(log, Level.SEVERE, e);
voidlogStackTrace(Throwable e, Logger logger)
log Stack Trace
if (logger.isDebugEnabled()) {
    StringWriter sw = new StringWriter();
    e.printStackTrace(new PrintWriter(sw));
    logger.debug(COMMUNICATION, sw.toString());