Code example for LogRecord

Methods: getParameters

0
    /* (non-Javadoc) 
     * @see java.util.logging.Formatter#format(java.util.logging.LogRecord) 
     */ 
    public String format(LogRecord lr) { 
//        Throwable ex = lr.getThrown(); 
        Throwable ex = (Throwable)lr.getParameters()[1]; 
//        LocalizedError err = (LocalizedError) lr.getParameters()[1]; 
//        Throwable ex = (Throwable)err.exception; 
        StringWriter sw = new StringWriter(); 
        ex.printStackTrace(new PrintWriter(sw)); 
 
        return super.format(lr) + " " + sw.toString(); 
    } 
} 
 
 
Contextual code suggestions in your IDE  Get Codota for Java