com.sun.enterprise.server.logging
Class UniformLogFormatter
java.lang.Object
java.util.logging.Formatter
com.sun.enterprise.server.logging.UniformLogFormatter
@Service
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public class UniformLogFormatter
- extends java.util.logging.Formatter
UniformLogFormatter conforms to the logging format defined by the
Log Working Group in Java Webservices Org.
The specified format is
"[#|DATETIME|LOG_LEVEL|PRODUCT_ID|LOGGER NAME|OPTIONAL KEY VALUE PAIRS|
MESSAGE|#]\n"
- Author:
- Hemanth Puttaswamy
TODO:
1. Performance improvement. We can Cache the LOG_LEVEL|PRODUCT_ID strings
and minimize the concatenations and revisit for more performance
improvements
2. Need to use Product Name and Version based on the version string
that is part of the product.
3. Stress testing
4. If there is a Map as the last element, need to scan the message to
distinguish key values with the message argument.
| Methods inherited from class java.util.logging.Formatter |
getHead, getTail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NVPAIR_SEPARATOR
public static final char NVPAIR_SEPARATOR
- See Also:
- Constant Field Values
NV_SEPARATOR
public static final char NV_SEPARATOR
- See Also:
- Constant Field Values
UniformLogFormatter
public UniformLogFormatter()
UniformLogFormatter
public UniformLogFormatter(FormatterDelegate delegate)
setDelegate
public void setDelegate(FormatterDelegate delegate)
format
public java.lang.String format(java.util.logging.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.
- Specified by:
format in class java.util.logging.Formatter
formatMessage
public java.lang.String formatMessage(java.util.logging.LogRecord record)
- Overrides:
formatMessage in class java.util.logging.Formatter
getProductId
protected java.lang.String getProductId()
- Sun One AppServer SE/EE can override to specify their product version
getNameValuePairs
protected void getNameValuePairs(java.lang.StringBuilder buf,
java.util.logging.LogRecord record)
- Sun One Appserver SE/EE? can override to specify their product specific
key value pairs.
getRecordBeginMarker
public java.lang.String getRecordBeginMarker()
setRecordBeginMarker
public void setRecordBeginMarker(java.lang.String recordBeginMarker)
getRecordEndMarker
public java.lang.String getRecordEndMarker()
setRecordEndMarker
public void setRecordEndMarker(java.lang.String recordEndMarker)
getRecordFieldSeparator
public java.lang.String getRecordFieldSeparator()
setRecordFieldSeparator
public void setRecordFieldSeparator(java.lang.String recordFieldSeparator)
getRecordDateFormat
public java.lang.String getRecordDateFormat()
setRecordDateFormat
public void setRecordDateFormat(java.lang.String recordDateFormat)
Copyright © 2012 GlassFish Community. All Rights Reserved.