public class LogParameterUtil
extends java.lang.Object
The rules are:
Map are interpreted as name-value pairs
and show up in the XML log output as <Data Name="key">value</Data>
<Data Name="LoggedParameter">value</Data>
Map parameter that contains the key isAcsPropertiesMap.
Those values are recognized by the log formatter and result in special fields being set, instead of
<Data/> elements being constructed.
When adding this map as a log parameter, it should be created using method createPropertiesMap().
LogRecord,
which can be set in the constructor or overwritten in setCurrentLogRecord(LogRecord).| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
IS_ACS_PROPERTIES_MAP_KEYNAME |
static java.lang.String |
PARAM_HOSTNAME |
static java.lang.String |
PARAM_LINE |
static java.lang.String |
PARAM_PRIORITY |
static java.lang.String |
PARAM_PROCESSNAME |
static java.lang.String |
PARAM_SOURCEOBJECT |
static java.lang.String |
PARAM_STACK_ID |
static java.lang.String |
PARAM_STACK_LEVEL |
static java.lang.String |
PARAM_THREAD_NAME |
static java.lang.String |
PARAM_URI |
| Constructor and Description |
|---|
LogParameterUtil(java.util.logging.LogRecord currentLogRecord) |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
createPropertiesMap()
Creates a new special properties map.
|
long |
extractLongProperty(java.lang.String name,
long defaultValue)
Extracts property with specified name of type long from the special properties map.
|
java.lang.String |
extractStringProperty(java.lang.String name,
java.lang.String defaultValue)
Extracts property with specified name of type String from the special properties map.
|
java.util.List<java.lang.Object> |
getNonSpecialPropertiesMapParameters()
Returns parameters of the current log record which are different from the special Properties
Map. |
void |
setCurrentLogRecord(java.util.logging.LogRecord logRecord)
Sets the log record from which the other methods can extract information.
|
public static final java.lang.String IS_ACS_PROPERTIES_MAP_KEYNAME
public static final java.lang.String PARAM_THREAD_NAME
public static final java.lang.String PARAM_LINE
public static final java.lang.String PARAM_HOSTNAME
public static final java.lang.String PARAM_STACK_ID
public static final java.lang.String PARAM_STACK_LEVEL
public static final java.lang.String PARAM_PRIORITY
public static final java.lang.String PARAM_URI
public static final java.lang.String PARAM_PROCESSNAME
public static final java.lang.String PARAM_SOURCEOBJECT
public LogParameterUtil(java.util.logging.LogRecord currentLogRecord)
public static java.util.Map<java.lang.String,java.lang.Object> createPropertiesMap()
public void setCurrentLogRecord(java.util.logging.LogRecord logRecord)
logRecord - public java.util.List<java.lang.Object> getNonSpecialPropertiesMapParameters()
Map.
These parameters may still be of type Map.
The returned list is "live", so don't muck with it.
public long extractLongProperty(java.lang.String name,
long defaultValue)
name - name of the propertydefaultValue - value returned if failed to obtain property valuedefaultValue on failurepublic java.lang.String extractStringProperty(java.lang.String name,
java.lang.String defaultValue)
name - name of the propertydefaultValue - value returned if failed to obtain property valuedefaultValue on failure