BTP Application Logging Part 3: Log Correlation and Troubleshooting Across Services
Trace one business request across app router, CAP services, external APIs and integration flows using correlation IDs; combine application logs with Integration Suite message processing logs; and run a structured troubleshooting approach for distributed BTP solutions.
Explanation
📌 KEY POINTS
✅ A correlation ID passed in HTTP headers links log entries across services.
✅ App router and SAP logging libraries propagate/create correlation IDs.
✅ Integration Suite MPLs have message IDs; log the correlation/message IDs in both worlds to connect them.
✅ Use a consistent troubleshooting path: symptom → correlation ID → service logs → integration MPL → back end.
⚠️ Enabling trace log level in Integration Suite for long periods stores payloads and expires quickly — use it briefly.
━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE
Part 2 configured logging. Now correlation.
━━━━━━━━━━━━━━━━━━━━
▶ 1. CORRELATION IDS
- Header propagation; generation at entry point.
━━━━━━━━━━━━━━━━━━━━
▶ 2. CROSS-SERVICE SEARCH
- Dashboard filter by correlation ID.
━━━━━━━━━━━━━━━━━━━━
▶ 3. INTEGRATION LOGS
- MPL, message ID, custom headers.
━━━━━━━━━━━━━━━━━━━━
▶ 4. TROUBLESHOOTING PATH
- Layer by layer.
━━━━━━━━━━━━━━━━━━━━
▶ 5. ALERTING
- Error-level alerts; dashboards.
━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP
- Send a request with a correlation header.
- Find its entries in app and router logs.
- Link to the iFlow MPL.
✅ CHECKPOINT: one request traced end to end.
Code example
===== CORRELATION FLOW =====Browser → app router (creates X-CorrelationID) → CAP service (logs correlation_id) → iFlow (log as custom header in MPL) → S/4HANA ===== INTEGRATION SUITE =====Monitor → Message Processing → filter by custom header / message IDLog level: Info (default) | Debug | Trace (short-lived; includes payloads)Real project scenario
A support engineer noticed an order confirmation failing only sometimes. Using the correlation ID from the user's error message, logs showed the CAP service calling an iFlow whose MPL reported a mapping error for one country. The fix took an hour instead of days.
Common mistakes
- No correlation IDs.
- Long trace levels.
- Services not forwarding headers.
- Siloed logs.
- No alerts.
Best practices
- Correlation everywhere.
- Short trace windows.
- Forward headers.
- Link app and MPL logs.
- Alerts on errors.
Interview angle
Questions: "How do you trace a request across services?", "How do app logs relate to MPL?", "What is your troubleshooting path?"
Strong answer: correlation IDs, search, integration logs, path, alerting.
Practice this lesson
Quick check
1. In SAP Cloud Integration (part of SAP Integration Suite), which log level must be assigned to an integration flow to capture full payload content, including headers and body, at each processing step for detailed troubleshooting?
2. How do you trace one user request across app router, CAP service and an iFlow?
3. A support engineer notices that an integration flow set to Trace log level automatically reverted to a lower log level after some time without manual intervention. What is the primary reason SAP Cloud Integration behaves this way?
Interview questions
1. A production issue is reported in Application Logging. What would you check first, and how would you troubleshoot it systematically?
Answer it in your own words first, then compare.
2. Suppose you inherit an existing Application Logging solution. How would you review it before making a change?
Answer it in your own words first, then compare.
Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.