Class ODLLogFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- com.sun.enterprise.server.logging.CommonFormatter
-
- com.sun.enterprise.server.logging.AnsiColorFormatter
-
- com.sun.enterprise.server.logging.ODLLogFormatter
-
- All Implemented Interfaces:
LogEventBroadcaster
public class ODLLogFormatter extends AnsiColorFormatter implements LogEventBroadcaster
ODLLogFormatter conforms to the logging format defined by the Log Working Group in Oracle. The specified format is "[[timestamp] [organization ID] [Message Type/Level] [Message ID] [Logger Name] [Thread ID] [Extra Attributes] [Message]]\n"- Author:
- Naman Mehta
-
-
Constructor Summary
Constructors Constructor Description ODLLogFormatter()ODLLogFormatter(FormatterDelegate delegate, String excludeFields)ODLLogFormatter(String excludeFields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(LogRecord record)_REVISIT_: Replace the String Array with an HashMap and do some benchmark to determine whether StringCat is faster or Hashlookup for the template is faster.StringformatMessage(LogRecord record)StringgetMessageWithoutMessageID(String message)StringgetRecordDateFormat()StringgetRecordFieldSeparator()voidinformLogEventListeners(LogEvent logEvent)Broadcast the log event to registered listeners.voidsetDelegate(FormatterDelegate delegate)voidsetRecordDateFormat(String recordDateFormat)voidsetRecordFieldSeparator(String recordFieldSeparator)-
Methods inherited from class com.sun.enterprise.server.logging.AnsiColorFormatter
color, getColor, getLoggerColor, getReset, noAnsi
-
Methods inherited from class com.sun.enterprise.server.logging.CommonFormatter
getProductId, isFieldExcluded
-
-
-
-
Constructor Detail
-
ODLLogFormatter
public ODLLogFormatter()
-
ODLLogFormatter
public ODLLogFormatter(String excludeFields)
-
ODLLogFormatter
public ODLLogFormatter(FormatterDelegate delegate, String excludeFields)
-
-
Method Detail
-
setDelegate
public void setDelegate(FormatterDelegate delegate)
-
format
public String format(LogRecord record)
_REVISIT_: Replace the String Array with an HashMap and do some benchmark to determine whether StringCat is faster or Hashlookup for the template is faster.
-
formatMessage
public String formatMessage(LogRecord record)
- Overrides:
formatMessagein classFormatter
-
getRecordFieldSeparator
public String getRecordFieldSeparator()
-
setRecordFieldSeparator
public void setRecordFieldSeparator(String recordFieldSeparator)
-
getRecordDateFormat
public String getRecordDateFormat()
-
setRecordDateFormat
public void setRecordDateFormat(String recordDateFormat)
-
informLogEventListeners
public void informLogEventListeners(LogEvent logEvent)
Description copied from interface:LogEventBroadcasterBroadcast the log event to registered listeners.- Specified by:
informLogEventListenersin interfaceLogEventBroadcaster
-
-