Skip to content
Menu

PAYMENT GATEWAY

F.5 Logging and Monitoring Best Practices

Observability, logging, and monitoring are essential to ensure visibility, traceability, and operational awareness of payment flows.

They enable the Merchant to detect anomalies, troubleshoot issues, and ensure that transaction processing behaves correctly under real-world conditions, including failures, retries, and asynchronous events.

Scope and Positioning

While other chapters define transaction flows, payload structures, and state semantics, this chapter focuses on how those interactions are observed, monitored, and diagnosed in real-world operational environments.

Logging and monitoring practices must ensure that:

  • All relevant system and transaction events are observable and traceable
  • Transaction flows can be reconstructed end-to-end
  • Observability mechanisms should consistently correlate transaction-related events using identifiers such as transactionID, merchant.merchantTransactionId, paymentMethod, paymentType, notificationID where applicable to webhook processing, and internal request correlation identifiers, ensuring that synchronous operations, asynchronous notifications, retries, and reconciliation workflows remain traceable across distributed systems
  • Operational issues and anomalies can be detected promptly
  • Systems can be diagnosed and recovered under failure conditions in a controlled manner

These practices support both real-time operational needs and post-incident analysis and must be implemented as core operational capabilities across all environments.

Observability of Asynchronous Flows

Asynchronous communication introduces additional complexity that must be observable and traceable.

  • Events may be delayed, duplicated, or received out of order
  • Processing may occur independently of the original request lifecycle

The Merchant system must ensure that:

  • Asynchronous events are tracked from reception to processing
  • Each event is correlated with its originating transaction
  • Missing, duplicated, or inconsistent events can be detected

Figure – End-to-End Observability Across API Requests, Webhooks, Status Inquiry, and Monitoring

Monitoring systems should also detect webhook delivery retries, repeated notifications, delayed processing, and inconsistencies between webhook events and Status Inquiry responses, enabling reliable reconciliation and duplicate-safe transaction handling.

Webhook delivery semantics, asynchronous notification handling, and transaction status reconciliation mechanisms are further detailed in E.1 – Webhooks (Notifications) and E.2 – Status Inquiry / Get Status.

Observability of asynchronous flows is essential to maintain consistency when handling external inputs and transaction updates, particularly in environments where final outcomes are not immediately available.

Security and Data Protection Considerations

Logging and monitoring must be implemented without compromising security.

  • Sensitive data must never be exposed through logs or monitoring systems
  • Authentication credentials, tokens, and confidential identifiers must be protected
  • Logging must balance diagnostic value with data protection requirements

Sensitive payment information such as PAN values, CVV/security codes, authentication tokens, Digest signatures, and confidential payload elements must be masked or omitted from logs, monitoring platforms, and operational traces.

Improper logging practices may introduce security vulnerabilities or lead to unintended data exposure, particularly when handling request and response payloads.

Additional security guidance regarding credential protection, PCI-sensitive data handling, and secure integration practices is provided in F.4 – Security Best Practices.

Operational Role

Logging and monitoring are critical for:

  • Detecting abnormal system behavior
  • Identifying failed or inconsistent transactions
  • Detecting unexpected or inconsistent transaction state transitions across asynchronous processing stages
  • Supporting incident response and recovery
  • Providing traceability for audit and compliance

Examples include abnormal increases in failed transactions, repeated timeout conditions, delayed transaction finalization, webhook processing failures, inconsistent transaction states, and unexpected retry patterns affecting payment operations.

They must be treated as core operational controls, integrated into system design and consistently enforced across all environments.

Failure to implement proper logging and monitoring may result in undetected issues, delayed incident response, and inability to diagnose or audit transaction behavior.

Operational resilience, production deployment considerations, and retry-related integration risks are further discussed in F.6 – Production Readiness Guidelines and F.7 – Common Integration Pitfalls.

Key Principle

Observability must be enforced as a system-wide capability, ensuring that all transaction flows, state transitions, and external interactions can be monitored, traced, and interpreted under real-world conditions.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.