Following this guide allows you to benefit from default contents, such as dashboards, index patterns, and retention settings.
Even without any specific application logs, you can analyze your applications based on the automatically issued request logs from the Cloud Foundry router.
You can Ingest via OpenTelemetry API Endpoint. There are no predefined dashboards yet, but you can use the observability plugin by OpenSearch Dashboards.
Ship logs from applications deployed on SAP BTP Cloud Foundry by binding the application. Bind applications either using the SAP BTP Cockpit or the Cloud Foundry Command Line Interface (CLI).
If you delete the service key, the certificates and credentials are invalidated.
Skip this step and bind to your application directly if you are sending with certificates (as it manages certificate rotation for you).
Bind the application directly to an SAP Cloud Logging instance. However, to be resilient against issues during the binding process (important for automated builds), we recommend an indirection via service key and binding to a user-provided service. Cloud Foundry operations can lead to an implicit rebind, without the need for a rebind. Using service keys provides control over the credential lifecycle.
-
cf services
lists the service instance. -
To create a service key without binding to any application via
cf cli
, execute the following command:cf create-service-key <service-instance> <service-key>
SAP Cloud Logging needs no configuration parameters during service key creation.
-
The service key holds all the credentials. To view a service key, execute:
cf service-key <service-instance> <service-key>
and extract ingest-endpoint, ingest-username, and ingest-password.
-
Create a user-provided service using the following pattern:
cf cups <user-provided-service-name> -l https://ingest-username:ingest-password@ingest-endpoint/cfsyslog
- Create a service key according to Creating Service Keys in Cloud Foundry.
- Create a User-Provided Service following Creating User-Provided Service Instances in Cloud Foundry Environment, using the information from the service key
Instance Name:<user-provided-service-name>
System Logs Drain URL: https://ingest-username:ingest-password@ingest-endpoint/cfsyslog
SAP Cloud Logging needs no configuration parameters during service key creation.
To bind the application using CF CLI, execute the following command:
cf bind-service <app-name> <service-instance>
CF CLI asks you to restage, but this isn't mandatory to use SAP Cloud Logging.
You can bind service instances to applications both at the application view, and at the service-instance view in the cockpit.
-
Log On to the Cloud Foundry environment using the SAP BTP Cockpit.
-
Navigate to the space in which your application is deployed. For more information, see Navigate to Global Accounts, Subaccounts, Orgs, and Spaces in the Cockpit.
-
In the navigation area, choose Services > Service Marketplace.
-
Search for SAP Cloud Logging.
-
In the navigation area, choose
Instances
. -
To create a new instance, choose
New Instance
. In the following steps, you assign an application to this service. This application then writes its logs to the newly created service instance.- Choose the service plan, then choose
Next
. - Optional. Browse for the .json file of the app for which you want to write logs. Then choose
Next
. - Optional. Choose an application from the dropdown that lists all deployed applications. Then choose
Next
. - Enter the name of the new instance, then choose
Finish
.
- Choose the service plan, then choose
-
Optional. If you haven't bound an application to the service instance in the optional steps above, you can bind it from the application’s dashboard. For more information, see Bind Service Instances to Applications Using the Cockpit.
You can share a single service instance across multiple spaces. Skip this step if you don't need to share a single instance across multiple spaces of the same org. To share the services in an additional space, execute the following command:
cf share-service <service-instance> -s <other-space>
Ensure that you consider the SAP BTP Security Recommendation BTP-CLS-0002.
We recommend using one of the Cloud Foundry open-source logging libraries (Java/NodeJS) within your application.