File-based Logging of Message Payload
IPF provides the possibility to store payload of incoming or outgoing messages of eHealth transactions into files.
Warning: This feature is intended for debug purposes and may lead to performance problems when used in highly loaded production environment without proper configuration. Making saved messages available for non-authorized persons may cause data privacy risks.
This feature is implemented in form of MLLP and CXF interceptors, depending on the protocol.
The configuration of these interceptors is uniform. Their constructors require a single String parameter that corresponds to the name pattern of the log files to be created. This pattern can contain absolute or relative path and is defined using the Spring Expression Language (SpEL), with square brackets as expressions placeholders.
The following specific values can be used in the expressions:
|Value Name||Value Type||Description|
|processId||String||Identifier of the current OS process, consisting from the process number and the host name, divided by a dash, e.g. ā31415-ipfSuperMainframeā?|
|sequenceId||String||Internally generated sequence number|
|date('format')||String||Current date and time, formatted using SimpleDateFormat according to the given specification|
The file name pattern configured for an interceptor can be changed at any time using the corresponding setter method. When the file denoted by the pattern does already exist, the new message payload will be appended at the end of the existing content.
The actual logging is delegated to subclasses of org.openehealth.ipf.commons.ihe.core.payload.PayloadLoggerBase. This base class provide additional fields which can be set via logging interceptor instances:
|Field name||Type||Default Value||Description|
|globallyEnabled||boolean (static)||true||switch file-based logging on and off in the whole application|
|locallyEnabled||boolean||true||whether this particular interceptor instance is enabled or disabled|
|errorCountLimit||int||-1||Maximal allowed count of messages this interceptor instance has sequentially failed to handle. When this value has been reached, the interceptor gets deactivated until resetErrorCount() is called. Negative values (the default) mean āno limitā?|
Note that even the globally deactivated logging may lead to performance penalties because the corresponding interceptors remain still deployed and perform some non-avoidable activities on each message.
Since IPF 3.3, the configuration of payload logging is changed as follows: * Field globallyEnabled is replaced with Java system property org.openehealth.ipf.commons.ihe.core.payload.PayloadLoggerBase.DISABLED of type Boolean. Setting this system property to true is equivalent to setting globallyEnabled to false, any other value or unset property is is equivalent to setting globallyEnabled to true. * Field locallyEnabled is renamed to simply enabled. * A new Java system property org.openehealth.ipf.commons.ihe.core.payload.PayloadLoggerBase.DISABLED is introduced. When it is set to true, message payload will be written down using regular Java logging mechanisms instead of custom files.