Payment Service Logging

By default, logging outputs to /var/log/mtx/payment-service.log (or the value of $MTX_LOG_DIR). The log rolls over when it reaches 2 MB and a maximum of 10 logs are saved.

To customize Payment Service logging, copy the sample configuration file /opt/mtx/data/log4j2-mtx-payment-service.xml to the opt/mtx/conf/log4j2-mtx-payment-service.xml directory to ensure that the file is not overwritten during an upgrade.

For example, to change the default logging level, add the following to /opt/mtx/data/log4j2-mtx-payment-service.xml:
<Logger name="org.springframework" level="debug" additivity="false">
            <AppenderRef ref="File-Appender"/>
        </Logger>

Log entries for the same payment request have the same ID.

To enable additional information in the logs for call-outs to Braintree, you must enable the following packages in /opt/mtx/data/log4j2-mtx-payment-service.xml:
<Logger name="com.matrixx.service.payment.processor.PaymentOperationProcessor" level="debug" additivity="false">
            <AppenderRef ref="File-Appender"/>
        </Logger>
        <Logger name="com.matrixx.service.payment.gateway.providers.BraintreePaymentGateway" level="debug" additivity="false">
            <AppenderRef ref="File-Appender"/>
        </Logger>
The following log shows a sample grouping in the log entry.
2019-11-26 15:01:59.256 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.p.PaymentOperationProcessor      : ID=0:1:31:21 {
    "$": "MtxPaymentOpMsg",
    "Amount": 50.0,
    "ChrgInQueueId": 0,
    "GatewaySocketId": 1610612737,
    "IsGroup": false,
    "PaymentGatewayId": 0,
    "PaymentGatewayOpDescription": "PURC:50.0:1",
    "PaymentGatewayUserId": "615458996",
    "PaymentMethodName": "My Test Visa",
    "PaymentMethodType": "CreditCard",
    "PaymentOp": "authorization_settlement",
    "PaymentOpObjectId": "0-1-31-21",
    "PaymentToken": "1234567890qwertyuiop",
    "Result": 0,
    "TimeArray": [1574809319213846],
    "WalletOwnerExternalId": "user001",
    "WalletOwnerId": "0-1-5-1"
}
...
2019-11-26 15:01:59.382 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.g.p.BraintreePaymentGateway      : ID=0:1:31:21 > BT paymentMethod().find()
2019-11-26 15:01:59.649 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.g.p.BraintreePaymentGateway      : ID=0:1:31:21 < BT paymentMethod().find(), isSuccess=true
...
2019-11-26 15:01:59.655 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.g.p.BraintreePaymentGateway      : ID=0:1:31:21 > BT transaction().sale()
2019-11-26 15:02:00.904 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.g.p.BraintreePaymentGateway      : ID=0:1:31:21 < BT transaction().sale(), isSuccess=true
...
2019-11-26 15:02:00.913 DEBUG 25379 --- [pool-4-thread-1] c.m.s.p.p.PaymentOperationProcessor      : ID=0:1:31:21 {
    "$": "MtxPaymentOpResultMsg",
    "ChrgInQueueId": 0,
    "GatewaySocketId": 1610612737,
    "PaymentGatewayResponseAttr": {
        "$": "MtxBraintreeResponseExtension",
        "AuthorizationExpiresAt": "2019-12-03T15:02:00",
        "ProcessorResponseCode": "1000",
        "ProcessorResponseText": "Approved",
        "ProcessorResponseType": "APPROVED",
        "ProcessorSettlementResponseCode": "",
        "ProcessorSettlementResponseText": "",

For more information about the MATRIXX environment variables, see the discussion about installation directories, navigation shortcuts, and environment variables in MATRIXX Installation and Upgrade.