Skip to Content

Enable Logging Service for Your Application

This tutorial shows you how to enable Logging Service for your application.
You will learn
  • How to access logs from command line window and SAP BTP cockpit
  • How to analyze logs using Kibana dashboard
  • How to enable Logging Service for your CAP application
  • How to test the Logging Service
  • Step 1
    1. Display recent logs.

      cf logs --recent <appname>
    2. Follow logs live.

      cf logs <appname>

    Choose Ctrl + C to quit.

    Which command is used to display application logs?

    Log in to complete tutorial
  • Step 2
    1. In SAP BTP Cockpit enter your Global Account. If you are using a trial account, choose Go To Your Trial Account.

    2. Choose Account Explorer.

    3. In the Subaccounts tab, choose the subaccount where you have deployed your service and application.

      Choose Subaccount
    4. Choose Cloud FoundrySpaces.

    5. Choose your space.

    6. Choose on the application whose logs you want to access.

    7. Choose Logs.

      App Logs

      Only the recent logs are displayed.

    Log in to complete tutorial
  • Step 3
    1. In SAP BTP Cockpit, navigate to your Subaccount.

    2. Choose Cloud FoundrySpaces.

    3. Choose your space.

    4. Choose the application whose logs you want to access.

    5. Choose Logs.

    6. Choose Open Kibana Dashboard.

      Kibana shows all logs.

      Although the Open Kibana Dashboard link is placed on the logs view of a particular application, it will give you access to the logs of all spaces where you have the required permission.

    Log in to complete tutorial
  • Step 4
    Log in to complete tutorial
  • Step 5
    1. Build the MTAR file and deploy it to your Cloud Foundry space:

      mbt build -t ./
      cf deploy cpapp_1.0.0.mtar
    2. Open Kibana after successful deployment. Your org should now be visible in the Kibana dashboard.

      Kibana: Filter Org
    3. Choose the ( + ) icon to filter for it.

    4. The filter is added to the filter bar on the top of the screen and gets applied on the dashboard.

    5. You should see your newly applied applications.

      Kibana: Components

    You can also browse all logs using the Discover button (compass icon) on the left navigation bar.
    The available fields are displayed on the left side of the screen. You can add fields to the message display or quickly filter for any of the top values.

    The time filter is on the right top of the screen. Don’t forget to choose Refresh.

    The result of this tutorial can be found in the logging branch.

    Log in to complete tutorial
Back to top