How to download logs from Figaf app in SAP BTP

How to download logs from Figaf app in SAP BTP

SAP BTP cockpit allows accessing only the last 1000 lines of logs. Sometimes it's enough for debugging but in most cases, it's not. So there is a way to download all needed logs directly from the app.
First of all, you need to execute next two commands:
  1. cf enable-ssh APP-NAME
  2. cf restart APP-NAME
Enable-ssh and restart should be executed only once here. If ssh is already enabled, you don't need to repeat these steps again. Unfortunately, the file system (including the logs) got recreated after restarting of the application. In other words, it means that you will be able to download only the logs recorded after the previous restart.

You need to proceed with the following commands:
  1. cf app APP-NAME --guid
  2. cf curl /v2/info
  3. cf ssh-code
Then you can connect to the application. If you are a Windows user, it's easy to use WinSCP program with the following parameters:
File protocol: SFTP
Host name and port: copy from "app_ssh_endpoint" field of the 4th command.
User name: cf:APP-GUID/0 where APP-GUID is a result of the 3rd command.
Password: result of the 5th command. 
This ssh code is valid for a short period of time. So execute cf ssh-code again if the code is expired.
For example:


Then you can open /logs folder and download the files to your local computer.
You can find more details about ssh here: https://docs.cloudfoundry.org/devguide/deploy-apps/ssh-apps.html

    • Related Articles

    • Deploy to SAP BTP, Cloud Foundry

      This article describes how to deploy the Figaf tool to CPI BTP, Cloud Foundry. Install "cf" command on your computer https://github.com/cloudfoundry/cli/wiki/V7-CLI-Installation-Guide#installers-and-compressed-binaries. Log in to your SAP BTP account ...
    • Start here to install the Figaf Tool

      If you are looking to run Figaf there is a number of ways. Where The Figaf Tool is a standalone Java application that makes it easy to run in several different locations. We support Java 8.  You can use Oracle 8 if you have a corporate license; we ...
    • How to add xslt templates to the tool deployed in SAP BTP

      Migration from PI/PO systems to CPI systems is one of the most important features of the Figaf tool. Here you can find more details about it: https://help.figaf.com/portal/en/kb/configuration/pi-to-cpi It requires XSLT templates placed on a server. ...
    • Onboarding/Installation (Figaf DevOps Suite - Cloud Version)

      In this mission you will see how to connect to your SAP Cloud Integration system.   1) Open the email you have received 2) Click on the link to open the page and enter a new password 3) Now you are in the Figaf Tool The screen may change a little ...
    • How to use PI/PO systems in SAP BTP

      PI/PO systems are usually located in a private environment so you need to use special SAP services to organize the connection. First of all, configure a cloud connector on the system which has access to PI/PO. (Configuration of the cloud connector is ...