Package org.jpos.util
Class ProtectedLogListener
- java.lang.Object
-
- org.jpos.util.ProtectedLogListener
-
- All Implemented Interfaces:
java.util.EventListener
,Configurable
,LogListener
public class ProtectedLogListener extends java.lang.Object implements LogListener, Configurable
Protects selected fields from LogEvents. ProtectedLogListener acts like a filter for Event logs, it should be defined _before_ other standard LogListeners such as SimpleLogListener or RotateLogListeners.
i.e.
Order is important. In the previous example SimpleLogListener will dump unprotected LogEvents while RotateLogListener will dump protected ones (for selected fields)<logger name="Q2"> <log-listener class="org.jpos.util.SimpleLogListener"/> <log-listener class="org.jpos.util.ProtectedLogListener"> <property name="protect" value="2 35 45 55" /> <property name="wipe" value="48" /> </log-listener> <log-listener class="org.jpos.util.RotateLogListener"> <property name="file" value="log/q2..log" /> <property name="window" value="86400" /> <property name="copies" value="5" /> <property name="maxsize" value="1000000" /> </log-listener> </logger>
- Since:
- jPOS 1.3.3
- See Also:
Configurable
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]
BINARY_WIPED
static java.lang.String
WIPED
-
Constructor Summary
Constructors Constructor Description ProtectedLogListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogEvent
log(LogEvent ev)
void
setConfiguration(Configuration cfg)
Configure this ProtectedLogListener
Properties:
[protect] blank separated list of fields to be protected [wipe] blank separated list of fields to be wiped
-
-
-
Field Detail
-
WIPED
public static final java.lang.String WIPED
- See Also:
- Constant Field Values
-
BINARY_WIPED
public static final byte[] BINARY_WIPED
-
-
Constructor Detail
-
ProtectedLogListener
public ProtectedLogListener()
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Configuration cfg) throws ConfigurationException
Configure this ProtectedLogListener
Properties:
- [protect] blank separated list of fields to be protected
- [wipe] blank separated list of fields to be wiped
- Specified by:
setConfiguration
in interfaceConfigurable
- Parameters:
cfg
- Configuration- Throws:
ConfigurationException
-
log
public LogEvent log(LogEvent ev)
- Specified by:
log
in interfaceLogListener
-
-