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.
Level | Usage | Identifier |
---|---|---|
VERBOSE | Traces all the log events including requests/responses with payload data and headers | v |
DEBUG | Traces all non-logging requests/responses with payload data and headers | d |
INFO | Traces all requests/responses without payload data and headers | i |
WARN | Logs events that are important but are not errors or fatal i.e. odd circumstances and contract violation assertion errors. | w |
ERROR | Traces only errors and exceptions. If request fails it would log URL, status code, and failure reason. | e |
Effective Log Level
Log Properties
AnyPay features following properties to log events as per your requirement
Property | Usage | Default Value |
---|---|---|
remoteLoggingEnabled | If set to true, sends all the configured logs to the cloud server | false |
logToFile | Writes all the logs to a local text file | true |
logToConsole | Writes all the logs to the console. Used for development using AnyPay SDK | false |
batchingInterval | Time interval in seconds to send the log batch to cloud server | 15 seconds |
logLevel | Log level for the events | ERROR |
realtimeLoggingEnabled | If true, sends the log batch to cloud every 5 seconds with realtime set to true | false |
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.
Logger | Description | Identifier |
---|---|---|
default | Logs regular events including requests/responses to cloud server | a |
device | Only logs events related to card reader. If not configured separately, it inherits its configuration properties from default logger configuration | d |
endpoint | Only logs requests/responses from endpoint api calls. If not configured separately, it inherits its configuration properties from default logger configuration | e |
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
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
Updated over 3 years ago