Android SDK - Appendix A - Custom Logging Utility

DOCS

Last updated: Aug 15th, 5:51am

The Android SDK exposes core and UI package methods that can be used to implement a custom logging utility that conforms to the Logging Format Specification provided.

Developers are cautioned to implement a custom solution only if specific requirements are not met by the standard Paydiant Logging Utility implementation.

ItemDescription
UI Packagecom.paydiant.android.ui.service.logging.PaydiantLoggingService exposes the following service methods.
Send Log Messagespublic void sendLogMessages(Map<String, String> logEntries)

This method sends the messages provided in the logEntries Map to the server. Each key in the logEntries Map is an application event such as successful login, failed login, etc.

The value is the event status along with any exceptions or other relevant information. In addition to the events, information related to the user device also needs to be sent to uniquely identify the device log entry and should contain other useful troubleshooting information. Keys related to some of the device information are available on the com.paydiant.android.core.enums.PaydiantLoggingEntryKey enum and the keys related to some application events are available on com.paydiant.android.core.enums.PaydiantLoggingEventType enum.

UI Implementation

ItemDescription
Applicable Listener Callbacksvoid onSendLogMessageSuccess();
Called when the log entries are successfully sent to the mobile gateway.

void onSendLogMessageFail(PaydiantException exception);
Called when the log messages could not be sent due to an error.
Set Logging Service Listenerpublic void setLoggingServiceListener(IPaydiantLoggingServiceListener loggingServiceListener)

Sets an implementation of com.paydiant.android.ui.service.logging.IPaydiantLoggingServiceListener
or an overridden instance of com.paydiant.android.ui.service.logging.PaydiantLoggingServiceListenerAdapter to handle callbacks.
Remove Listenervoid removeListener();
Call this method to remove the logging service listener and set it to null.

Core Package Methods

com.paydiant.android.core.facade.PaydiantLoggingManagerFacade exposes the following facade methods.

ItemDescription
Send Log Messagespublic void sendLogMessages(Map < String, String > logEntries)

Similar to the UI package method, this sends the messages provided in the logEntries map to the server.

Paydiant Logging Format Specification

This section defines the logging format required by the Core and UI package methods for custom logging implementations. This section also lists the applicable event types and their relevant parameter entries.

Log message format

Each log message must comply with the format and sequence specifications defined here. In addition, the following rules must be observed for all entries:

  1. Any entry given in the format key=value is considered a Map entry to be passed to the Core/UI package methods.
  2. Any entry prefixed with a $ (for example $application_version) is considered a variable to be set during runtime.
  3. Any entry surrounded with < and > is an expanded/extended format, which will be defined below the current content. For example:
Log message:= appVersion=$application_version < Device_Details > lastSucceessfulHeartbeat= $last_succeessful_heartbeat lastFailedHeartbeat=$last_failed_heartbeat < Event_Information > Device Details:= appVersionName=$appVersionName appVersionCode=4appVersionCode rooter=$rooted deviceId=$device_id deviceOS=$OS_version deviceManufacturer=$device_manufacturer deviceBrand=$device_brand deviceModel=$device_model deviceNumberOfProcesses=$number_of_processes_running deviceAvailableMemory=$available_memory Event Information:= event-001= < Event-1_Details > event-002= < Event-2_Details > ... event-n= < Event-n_Details >

Event-x details

The Event Details format can vary based on whether the event occurred while network connectivity was cellular or Wi-Fi.

If the event was triggered during cellular network connectivity:

date:$date_time_timezone|network:$cellular_network_name| < event_syntax >

If the event was triggered during Wi-Fi network connectivity:

date:$date_time_timezone|ssid:$wifi_ssid_name|macAddress:$wifi_mac_address| < event_syntax >

Logging Event Syntax and Parameters

The following index specifies the event syntax along with additional event parameters required for each use case.

Use CaseApp Log Event
(Append to "result:" in syntax)
Event Syntax
Loginlogin_successresult:login_success
login_fail`result:login_fail
Logofflogoff_successresult:logoff_success
logoff_fail`result:logoff_fail
Scanscan_success`result:scan_success
scan_fail`result:scan_fail
Get Transaction Informationtx_info_retrieve_success`result:tx_info_retrieve_success
tx_info_retrieve_fail`result:tx_info_retrieve_fail
Paymentpayment_success`result:payment_success
payment_fail`result:payment_fail
Cash Accesscash_access_success`result:cash_access_success
cash_access_fail`result:cash_access_fail
Refundrefund_success`result:refund_success
refund_fail`result:refund_fail
Cancel Paymentpayment_cancel_success`result:payment_cancel_success
payment_cancel_fail`result:payment_cancel_fail
Cancel Cash Accesscash_access_cancel_success`result:cash_access_cancel_success
cash_access_cancel_fail`result:cash_access_cancel_fail
Cancel Refundrefund_cancel_success`result:refund_cancel_success
refund_cancel_fail`result:refund_cancel_fail
Retrieve Accountsaccounts_retrieve_successresult:accounts_retrieve_success
accounts_retrieve_fail`result:accounts_retrieve_fail
Refresh All Accountsaccounts_refresh_successresult:accounts_refresh_success
accounts_refresh_fail`result:accounts_refresh_fail
Refresh One Accountaccount_refresh_successresult:account_refresh_success
account_refresh_fail`result:account_refresh_fail
Retrieve Receiptsreceipts_retrieve_success`result:receipts_retrieve_success
receipts_retrieve_failresult:receipts_retrieve_fail
Refresh Receiptsreceipts_refresh_successresult:receipts_refresh_success
receipts_refresh_failresult:receipts_refresh_fail
NFC Scannfc_scan_success`result:nfc_scan_success
nfc_scan_failedresult:nfc_scan_fail
Connection Lost (Heartbeat Failed)connection_lost`result:connection_lost
Check Device Statusdevice_status_check_success`result:device_status_check_success
device_status_check_fail`result:device_status_check_fail
Retrieve MFA Questionsmfa_questions_retrieve_successresult:mfa_questions_retrieve_success
mfa_questions_retrieve_fail`result:mfa_questions_retrieve_fail
Check User ID Availabilityuser_id_availability_check_successresult:user_id_availability_check_success
user_id_availability_check_fail`result:user_id_availability_check_fail
Register New Walletuser_registration_successresult:user_registration_success
user_registration_fail`result:user_registration_fail
Update User Profileuser_profile_update_successresult:user_profile_update_success
user_profile_update_failresult:user_profile_update_fail
Update Passwordpassword_update_successresult:password_update_success
password_update_failresult:password_update_fail
Update Passcodepasscode_update_successresult:passcode_update_success
passcode_update_fail`result:passcode_update_fail
Update MFA Answersmfa_answers_update_successresult:mfa_answers_update_success
mfa_answers_update_fail`result:mfa_answers_update_fail
Update Expired Passwordexpired_password_reset_successresult:expired_password_reset_success
expired_password_reset_fail`result:expired_password_reset_fail
Reset Forgotten Passwordpassword_reset_successresult:password_reset_success
password_reset_fail`result:password_reset_fail
Reset Forgotten Passcodepasscode_reset_successresult:passcode_reset_success
passcode_reset_fail`result:passcode_reset_fail
Request Forgotten Usernameusername_request_successresult:username_request_success
username_request_failresult:username_request_fail
Submit MFA Responsesmfa_answers_submit_successresult:mfa_answers_submit_success
mfa_answers_submit_failresult:mfa_answers_submit_fail
Retrieve Account Configurationsaccount_config_retrieve_successresult:account_config_retrieve_success
account_config_retrieve_fail`result:account_config_retrieve_fail
Add Payment Accountaccount_add_successresult:account_add_success
account_add_failresult:account_add_fail
Update Payment Accountaccount_update_successresult:account_update_success
account_update_failresult:account_update_fail
Delete Payment Accountaccount_delete_successresult:account_delete_success
account_delete_failresult:account_delete_fail
Activate Payment Accountaccount_activation_successresult:account_activation_success
account_activation_failresult:account_activation_fail
Unlink Devicedevice_unlink_successresult:device_unlink_success
device_unlink_failresult:device_unlink_fail
Install Wi-Fi Profilewifi_profile_installation_successresult:wifi_profile_installation_success
wifi_profile_installation_fail`result:wifi_profile_installation_fail
Retrieve Available Offersavailable_offer_retrieve_successresult:available_offer_retrieve_success
available_offer_retrieve_failresult:available_offer_retrieve_fail
Activate Offeravailable_offer_activate_successresult:available_offer_activate_success
available_offer_activate_failresult:available_offer_activate_fail
Retrieve Activated Offersmy_offer_retrieve_successresult:my_offer_retrieve_success
my_offer_retrieve_failresult:my_offer_retrieve_fail
Deactivate an Offermy_offer_remove_successresult:my_offer_remove_success
my_offer_remove_failresult:my_offer_remove_fail
Retrieve Password Policypassword_policy_retrieve_successresult:password_policy_retrieve_success
password_policy_retrieve_failresult:password_policy_retrieve_fail
Retrieve Billing Addressbilling_address_retrieve_successresult:billing_address_retrieve_success
billing_address_retrieve_fail`result:billing_address_retrieve_fail
Retrieve User Informationuser_info_retrieve_successresult:user_info_retrieve_success
user_info_retrieve_fail`result:user_info_retrieve_fail
Device Session Expireddevice_session_expiredresult:device_session_expired
Update Device Descriptiondevice_description_update_successresult:device_description_update_success
device_description_update_failresult:device_description_update_fail