public abstract class PayloadLoggerBase<T extends PayloadLoggingContext> extends Object
File name patterns can contain absolute and relative paths and must correspond to the SpEL syntax, using square brackets for referencing placeholder parameters. In the base version, the following parameters are supported (this set can be extended in derived classes):
SimpleDateFormat
according to the given specification.
As an alternative to SpEL, the user can provide another expression resolver
.
Furthermore, the behavior of this class is regulated application-widely by the following Boolean system properties:
true
, then the message payload will be logged using regular
Java logging mechanisms (level DEBUG) instead of being written into files whose names
are created from the pattern.true
, then no logging will be performed at all.Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_CONSOLE |
static String |
PROPERTY_DISABLED |
static String |
SEQUENCE_ID_PROPERTY_NAME |
Constructor and Description |
---|
PayloadLoggerBase() |
Modifier and Type | Method and Description |
---|---|
boolean |
canProcess() |
protected void |
doLogPayload(T context,
String charsetName,
String... payloadPieces) |
int |
getErrorCountLimit() |
ExpressionResolver |
getExpressionResolver() |
protected static Long |
getNextSequenceId() |
boolean |
isEnabled() |
static boolean |
isGloballyEnabled()
Deprecated.
use environment variable
PROPERTY_DISABLED |
boolean |
isLocallyEnabled()
Deprecated.
use
isEnabled() |
void |
resetErrorCount()
Resets count of occurred errors, can be used e.g.
|
void |
setEnabled(boolean enabled) |
void |
setErrorCountLimit(int errorCountLimit)
Configures maximal allowed count of file creation errors.
|
void |
setExpressionResolver(ExpressionResolver resolver) |
static void |
setGloballyEnabled(boolean globallyEnabled)
Deprecated.
use environment variable
PROPERTY_DISABLED |
void |
setLocallyEnabled(boolean locallyEnabled)
Deprecated.
|
public static final String SEQUENCE_ID_PROPERTY_NAME
public static final String PROPERTY_CONSOLE
public static final String PROPERTY_DISABLED
protected static Long getNextSequenceId()
public boolean canProcess()
public void resetErrorCount()
public boolean isEnabled()
true
if this logging interceptor instance is enabled.public void setEnabled(boolean enabled)
enabled
- true
when this logging interceptor instance should be enabled.@Deprecated public boolean isLocallyEnabled()
isEnabled()
true
if this logging interceptor instance is enabled.@Deprecated public void setLocallyEnabled(boolean locallyEnabled)
setEnabled(boolean)
locallyEnabled
- true
when this logging interceptor instance should be enabled.public static boolean isGloballyEnabled()
PROPERTY_DISABLED
true
when logging interceptors are generally enabled.isLocallyEnabled()
public static void setGloballyEnabled(boolean globallyEnabled)
PROPERTY_DISABLED
globallyEnabled
- true
when logging interceptors shall be generally enabled.setLocallyEnabled(boolean)
public int getErrorCountLimit()
public void setErrorCountLimit(int errorCountLimit)
errorCountLimit
- maximal allowed count of file creation errors,
negative value (the default) means "no limit".public ExpressionResolver getExpressionResolver()
public void setExpressionResolver(ExpressionResolver resolver)
Copyright © 2018 Open eHealth Foundation. All rights reserved.