Configuring and Consuming the Application Logging Service on Cloud Foundry and Kyma
Explains how to provision, bind, and configure the Application Logging service on Cloud Foundry, how logging works on Kyma, and how to retrieve and filter logs during troubleshooting and production support.
Explanation
Once a consultant understands why application logging matters, the next step is knowing how to actually provision and consume the logging capability on SAP BTP in a real subaccount. On the Cloud Foundry environment, the Application Logging service is typically created as a service instance in a space, using a plan appropriate to the landscape (development, lite, or a paid plan depending on availability in the region and contract). This service instance is then bound to one or more applications through the standard Cloud Foundry service binding mechanism, which injects credentials and endpoint information into the application's environment (commonly visible through VCAP_SERVICES). Binding does not automatically make an application log anything meaningful; it only establishes the pipeline. The application itself must still write logs to stdout/stderr, or in some architectures use a provided client library that forwards logs to the ingestion endpoint. A critical intermediate-level concept is understanding the difference between platform-level log capture and application-level log capture. Cloud Foundry automatically captures stdout/stderr from every application instance and can forward this into the bound logging service without any code changes, which is why even a simple console.log statement becomes visible centrally. However, some scenarios require applications to push logs directly through an API or SDK, especially when applications want to attach custom metadata, batch logs efficiently, or run outside the standard buildpack runtime. Consultants need to check the specific service documentation for the plan they are using to know whether automatic capture is sufficient or whether an SDK integration is required. On Kyma, the pattern is different because Kyma is a managed Kubernetes environment. Logging is generally handled through the underlying Kubernetes and Istio observability stack, where pods write to stdout/stderr, and a cluster-level log collection mechanism (such as a Fluent Bit or similar agent, depending on how the specific Kyma landscape is configured) forwards these logs to a backend for storage and querying. Because Kyma is Kubernetes-based, teams should also be familiar with basic 'kubectl logs' style access for real-time troubleshooting of a specific pod, in addition to whatever centralized dashboard the landscape provides. It is important not to assume Cloud Foundry service binding concepts apply directly to Kyma; the two environments use fundamentally different mechanisms even though the end goal (searchable centralized logs) is the same. Retrieving and filtering logs is where most day-to-day production support work happens. Typically this involves using a dashboard or query interface to filter by time range, application name, log level, or correlation ID. Consultants should get comfortable constructing queries that narrow down a large volume of logs to the specific failure window reported by a business user. A common intermediate skill is correlating an error timestamp reported by a user with the exact log entries from the responsible microservice, then tracing upstream and downstream components using the correlation ID to determine where in a multi-step integration flow the failure originated. Troubleshooting also requires understanding retention limits. Most application logging offerings retain logs only for a limited period (commonly a matter of days), so for compliance or long-term audit needs, teams must design a strategy to export or archive critical logs elsewhere, rather than assuming the logging service functions as permanent storage. Additionally, in multi-tenant or multi-application landscapes, proper naming conventions for the component or application field become essential, since dozens of applications may share the same logging backend, and unclear naming makes filtering nearly impossible during an actual incident under time pressure.
Code example
# Example: creating and binding an Application Logging service instance on Cloud Foundry (conceptual CLI flow) # 1. Create a service instance using an available plan in the spacecf create-service application-logs lite my-app-logging # 2. Bind the service instance to an existing applicationcf bind-service order-service my-app-logging # 3. Restage the application so the new service binding is picked upcf restage order-service # 4. Inspect environment to confirm credentials were injectedcf env order-service # --- On Kyma, real-time pod log inspection during troubleshooting ---# List pods to find the running instance of the applicationkubectl get pods -n my-namespace # Stream logs from a specific pod in real timekubectl logs -f order-service-6f9d8c9c9c-abcde -n my-namespaceReal project scenario
During a production incident, a business process integration between an e-commerce frontend and an S/4HANA Cloud backend, running through a custom Cloud Foundry microservice, started failing intermittently for a subset of orders. The support team used the centralized logging dashboard to filter by the affected time window and the microservice's component name, then searched for ERROR-level entries containing the correlation ID passed from the frontend. This allowed them to isolate the failures to a specific downstream timeout occurring only when order payloads exceeded a certain size, without needing to reproduce the issue in a lower environment.
Common mistakes
โข Assuming binding a logging service instance automatically improves log quality without any application-side logging discipline โข Confusing Cloud Foundry service binding concepts with how logging works on Kyma, leading to wrong troubleshooting steps โข Not restaging or restarting the application after binding a new service instance, so the binding never takes effect โข Relying on the logging service as long-term audit storage without understanding its retention limits โข Using inconsistent or generic component names across applications, making log filtering during incidents extremely difficult
Best practices
โข Establish a consistent application/component naming convention before onboarding multiple apps to the same logging backend โข Always restage or restart applications after binding or updating a logging service instance on Cloud Foundry โข Use correlation IDs generated at the entry point of a transaction and propagate them through every downstream call โข Understand and document the retention period of your logging plan, and export critical logs elsewhere if long-term audit is required โข On Kyma, combine centralized dashboard queries with direct kubectl log access for fast real-time debugging during incidents
Interview angle
A common intermediate interview question is to walk through how you would troubleshoot a failed integration in production using only centralized logs, including how you would bind a logging service, what you would filter on, and how you would correlate logs across multiple services using a correlation ID. Strong answers also mention the environment-specific differences between Cloud Foundry service binding and Kyma's Kubernetes-native log capture, showing awareness that BTP is not a single uniform runtime.