|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.misc.JavaLoggingExceptionListener
public final class JavaLoggingExceptionListener
Adapts FM-Classic's exception events to the java.util.logging
logging methods. The Java logging package is provided with Java 1.4 or later.
Usage example:
// Configure the logger Logger global = Logger.getLogger(""); Formatter simpleFormatter = new SimpleFormatter(); ConsoleHandler consoleHandler = new ConsoleHandler(); consoleHandler.setFormatter(simpleFormatter); global.addHandler(consoleHandler); // Set up the template Template template = new Template(filename); // Set up the model TemplateModelRoot modelRoot = (...) // Set up the listener SimpleEventAdapter adapter = new SimpleEventAdapter( new JavaLoggingExceptionListener() ); // Call the template template.process( modelRoot, writer, adapter ); // Flush the handler consoleHandler.flush();
Constructor Summary | |
---|---|
JavaLoggingExceptionListener()
Creates new JavaLoggingExceptionListener |
Method Summary | |
---|---|
void |
exceptionThrown(TemplateExceptionEvent e)
Passes exceptions raised by FM-Classic onto the Java logging API. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaLoggingExceptionListener()
Method Detail |
---|
public void exceptionThrown(TemplateExceptionEvent e)
exceptionThrown
in interface TemplateExceptionListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |