|
Sun Message Library for SWIFT API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Formatter
com.stc.swift.util.JDKLogFormatter
public class JDKLogFormatter
Provides a formatter for JDK logger (java.util.logging.Logger). It will produce a simple output in format:
Timestamp(yyyyMMdd:HHmmss.SSS)|Thread(threadName)|(logLevel)|(loggerName)[(logMessage)]
(newLine)[(stackTrace) if Throwable is present.]
This class can be used in one of following ways:
1. In log configuration file (logging.properties), set property for corresponding handlers, e.g.
java.util.logging.ConsoleHandler.formatter = com.stc.swift.util.JDKLogFormatter
2. Dynamically set the formatter for corresponding handlers, e.g.
XXXHandler handler = new XXXHandler(...);
handler.setFormatter(new com.stc.swift.util.JDKLogFormatter());
handler.setLevel(Level.yyy);
java.util.logging.Logger logger = java.util.logging.Logger.getLogger("some.logger");
logger.addHandler(handler);
logger.setLevel(Level.yyy);
| Constructor Summary | |
|---|---|
JDKLogFormatter()
Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
format(java.util.logging.LogRecord record)
|
| Methods inherited from class java.util.logging.Formatter |
|---|
formatMessage, getHead, getTail |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JDKLogFormatter()
| Method Detail |
|---|
public java.lang.String format(java.util.logging.LogRecord record)
format in class java.util.logging.FormatterFormatter.format(java.util.logging.LogRecord)
|
Sun Message Library for SWIFT API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||