Java Log Exception logException(Logger logger, String message, Throwable t)

Here you can find the source of logException(Logger logger, String message, Throwable t)

Description

log Exception

License

Open Source License

Declaration

public static void logException(Logger logger, String message, Throwable t) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.PrintWriter;
import java.io.StringWriter;

import java.util.logging.Logger;

public class Main {
    public static void logException(Logger logger, String message, Throwable t) {
        logger.warning(message);//from w  ww.  j a v a2s. c  o m
        logger.warning(excpToString(t));
    }

    public static String excpToString(Throwable t) {
        StringWriter output = new StringWriter();
        t.printStackTrace(new PrintWriter(output, false));
        return output.toString();
    }
}

Related

  1. logException(Exception e, Logger logger)
  2. LogException(Exception ex)
  3. logException(final Throwable exception)
  4. logException(int type, String RID, String subRID, String propIndication, String error)
  5. logException(Logger logger, Level logLevel, Exception e)
  6. logException(Logger logger, Throwable t)
  7. LogException(String description, Throwable e)
  8. logException(String msg, Exception ex)
  9. logException(Throwable t, Logger log, Level level)