Cloud Logging

AnyPay platforms provides support for diagnostic logging to file, the console and to the AnywhereCommerce cloud servers. It can be configured to log cloud api network calls, card reader events and endpoint requests/responses. Below are listed some key features:

  • File logging
  • Log to Console
  • Stream logs to cloud server
  • Separate loggers for endpoint and card reader related events
  • Prefix identifiers to identify logs
  • Configurable batching interval

Log Levels

Terminals can be configured to log events with different levels. Below are the different log levels AnyPay provides

  • VERBOSE
  • DEBUG
  • INFO
  • WARN
  • ERROR

By default ERROR is used if no level is set explicitly.

LevelUsageIdentifier
VERBOSETraces all the log events including requests/responses with payload data and headersv
DEBUGTraces all non-logging requests/responses with payload data and headersd
INFOTraces all requests/responses without payload data and headersi
WARNLogs events that are important but are not errors or fatal i.e. odd circumstances and contract violation assertion errors.w
ERRORTraces only errors and exceptions. If request fails it would log URL, status code, and failure reason.e

Effective Log Level

594

Log Properties

AnyPay features following properties to log events as per your requirement

PropertyUsageDefault Value
remoteLoggingEnabledIf set to true, sends all the configured logs to the cloud serverfalse
logToFileWrites all the logs to a local text filetrue
logToConsoleWrites all the logs to the console. Used for development using AnyPay SDKfalse
batchingIntervalTime interval in seconds to send the log batch to cloud server15 seconds
logLevelLog level for the eventsERROR
realtimeLoggingEnabledIf true, sends the log batch to cloud every 5 seconds with realtime set to truefalse
streamLogTo (beta)Set your own server url to send the logs to instead of sending it to cloud server

Loggers

Loggers log events. AnyPay segments them into three separate loggers. Each logger has a single character unique identifier which it marks a log event with.

LoggerDescriptionIdentifier
defaultLogs regular events including requests/responses to cloud servera
deviceOnly logs events related to card reader. If not configured separately, it inherits its configuration properties from default logger configurationd
endpointOnly logs requests/responses from endpoint api calls. If not configured separately, it inherits its configuration properties from default logger configuratione

Each logger can have its own set of configuration properties. For example device logger may be set to DEBUG level whereas endpoint logger can be configured to log ERROR events only. If device and endpoint properties are not set in the terminal JSON, default configuration is inherited and used. Configuration section below describes in detail how to set separate configurations in terminal JSON.

Logs from different loggers can be identified by its unique identifier. Each log event is prefixed with a timestamp, logger identifier, log level and event context.

timestamp [terminalMode | logger unique identifier | logger log level] Context ..LOG MESSAGE..

For example:

2020-07-09T12:01:33.2449057+05:30 [c|d|d] BBPOSEventDispatchControllerListener.onWaitingForCard [BBPOSDeviceEventDispatch]
checkCardMode: SWIPE_OR_INSERT_OR_TAP

Here c stands for terminalMode cloud. If terminalMode is app, a is used. All cloudbridge applications should have terminalMode set to cloud in terminal configuration

'd' in middle is the unique identifier for device logger

'd' is for debug log level

781 861 824

Configuration

This section explains how to configure terminal JSON to log desired events for debugging and testing.

JSON Structure

"configuration": {
  "logging": {
    "remoteLoggingEnabled": true,
    "logLevel": "DEBUG",
    "logToFile": true
  }
}

You can configure the default logging inside the configuration object of terminal. If device and endpoint logging configuration are not provided, configuration set for default logger would be used as their logger configuration.

endpoint logger configuration should be set inside the endpoint object as shown below:

"configuration": {
  "endpoint": {
      "provider": "propay",
      "xmlApiBaseUrl": "https://xmltest.propay.com/api/",
      "jsonApiBaseUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "x509Cert": "****",
      "certStr": "****",
      "splitfundingAccountNum": "",
      "flavor": "test",
      "gatewayUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "serverDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
      "terminalID": "****",
      "terminalId": "****",
      "logging": {
        "remoteLoggingEnabled": false,
        "logLevel": "DEBUG"
      }
}

device logger configuration should be set inside the cardReader object as shown below:

{
"configuration": {
  "cardReader": {
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "VERBOSE"
      }
    }
}
}

Below is the complete sample terminal json for reference.

{
  "activationCode": "******",
  "status": "ACTIVE",
  "uuid": "*****",
  "id": "****",
  "portfolio": "mycompany",
  "dateCreated": "2020-07-09T08:17:00.3693473+00:00",
  "dateModified": "2019-06-26T15:59:13.7509031+00:00",
  "configuration": {
    "requireDigestAuthentication": "false",
    "endpoint": {
      "provider": "propay",
      "xmlApiBaseUrl": "https://xmltest.propay.com/api/",
      "jsonApiBaseUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "x509Cert": "****",
      "certStr": "****",
      "splitfundingAccountNum": "",
      "flavor": "test",
      "gatewayUrl": "https://mobileapitest.propay.com/merchant.svc/json/",
      "serverDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
      "terminalID": "****",
      "terminalId": "****",
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "DEBUG"
      }
    },
    "cardReader": {
      "logging": {
        "remoteLoggingEnabled": true,
        "logLevel": "VERBOSE"
      }
    },
    "defaultDateFormat": "dd-MM-yyyy HH:mm:ss:SSS",
    "registerCardReaderWhenConnected": true,
    "cloudSyncEnabled": true,
    "allowDynamicTerminalCreation": true,
    "terminalMode": "Cloud",
    "allowAnonymousUsers": true,
    "allowClearTransactions": true,
    "allowPartialAuthorizations": true,
    "allowPartialRefunds": true,
    "allowReferencedRefunds": true,
    "allowUnreferencedRefunds": true,
    "chequeColorFormat": "Color",
    "chequeColorFormatEditable": true,
    "chequeFileFormat": "PNG",
    "chequeFileFormatEditable": true,
    "customFieldsEnabled": false,
    "customFieldsEnabledEditable": false,
    "defaultCardReader": "Sherpa",
    "defaultCardReaderEditable": true,
    "defaultCurrency": "USD",
    "driversLicenseRequired": false,
    "driversLicenseRequiredEditable": false,
    "driversLicenseStateRequired": false,
    "driversLicenseStateRequiredEditable": false,
    "enableAvs": true,
    "enableCvv": true,
    "enableFirmwareUpdate": false,
    "enableForgotPasswordUrl": false,
    "enabledCurrency": "USD",
    "enabledCurrencyEditable": false,
    "enabledEntryModes": "SWIPE INSERT TAP PINPAD",
    "enabledEntryModesEditable": false,
    "enabledPaymentMethods": "CREDIT",
    "enabledPaymentMethodsEditable": true,
    "enabledReceiptOptions": "Default",
    "enabledReceiptOptionsEditable": false,
    "enforce": true,
    "enforceFirmwareCompliance": false,
    "forgotPasswordUrl": "https://payments.anywherecommerce.com/merchant/selfcare",
    "geofencingEnabled": false,
    "geofencingEnabledEditable": false,
    "geolocationEnabled": true,
    "geolocationEnabledEditable": false,
    "id": "default",
    "requireAvs": false,
    "requireCardPresentRefunds": false,
    "requireCardPresentSales": false,
    "requireCvv": false,
    "requireTermsAndConditions": false,
    "sessionTimeoutEnabled": false,
    "sessionTimeoutEnabledEditable": true,
    "sessionTimeoutInterval": "Never",
    "supportedCurrencies": "ALL",
    "supportedEntryModes": "SWIPE INSERT TAP PINPAD",
    "supportedPaymentMethods": "CREDIT DEBIT CHEQUE",
    "supportedReceiptOptions": "Default",
    "surchargeEnabled": false,
    "surchargeEnabledEditable": true,
    "surchargeOptionsEditable": true,
    "suspendAndResumeEnabled": false,
    "suspendAndResumeEnabledEditable": false,
    "suspendAndResumeSupportedEntryModes": "SWIPE PINPAD",
    "suspendAndResumeSupportedPaymentMethods": "CREDIT",
    "taxEnabled": true,
    "taxEnabledEditable": true,
    "taxRatesEditable": true,
    "terminalEnabled": true,
    "termsAndConditionsUrl": "",
    "timestamp": "2018-01-01",
    "tipEnabled": true,
    "tipEnabledEditable": true,
    "tipOptionsEditable": true,
    "transactionReportingMode": "ALL_USERS",
    "transactionReportingModeEditable": true,
    "unreferencedRefundLimit": 99999,
    "userAuthenticationMode": "DEFER_UNTIL_REQUIRED",
    "verifyCardPresentForKeyedTransactions": false,
    "version": "default1",
    "dateModified": "10-09-2018 18:45:43:227",
    "allowKeyedTransactions": true,
    "cloudPOSURL": "https://api.payments.ac/",
    "logging": {
      "remoteLoggingEnabled": true,
      "logLevel": "DEBUG",
      "logToFile": true
    }
  }
}

Accessing File Logs

Log files are saved per platform specification and can be access as below:

Windows

Stored in Common Application Data folder.

C://ProgramData/AnyPay/Logs

macOS

Stored inside Container Library

~/Library/Containers/com.netsecure.CloudBridge/Data/Documents/Logs

iOS

Stored inside Application container Documents folder

Android

Stored inside /data directory of the app