Skip to Content
Technical Articles

SAP Cloud Platform Developer Onboarding III | Hands-on Video Tutorials

The SAP Cloud Platform developer onboarding video tutorial series from the SAP HANA Academy has just been updated to include SAP’s Business Application Studio (BAS) and Cloud Application Programming (CAP) model.

In this blog you will find the videos embedded with references and additional information.

Part I – About the concepts, free trial, accounts, service subscriptions and BAS

Part II – About application development, destinations, authentication, SAP HANA persistence, CAP, and XSJS compatibility

Part III – About the Application Logging and Audit Management services

Part IV – About local development

Part V – About custom domains

Questions? Please post as comment.

Useful? Give us a like and share on social media.

Thanks!

/wp-content/uploads/2016/02/sapnwabline_885687.png

Hands-On Video Tutorials – Part III

Philip MUGGLESTONE just updated his developer onboarding video tutorial series for the SAP Cloud Platform. In this blog, you will find the videos embedded with some additional information and resources. Following along in the patented zero-to-hero format, no prior knowledge required, you will be ready to start developing business applications on the platform with minimal effort and no time wasted.

You can watch the two video tutorials in about twenty minutes. What you learn is

  • How to view standard application logs
  • How to work with the Application Logging service and the Kibana dashboard
  • How to integrate application logging into your application
  • How to view standard audit logs
  • How to work with the Auditlog Management service
  • How to integrate audit logging into your application

To bookmark the playlist on YouTube, go to

Because we know your time is precious, we have included code snippets so you can easily and merrily code along. For the GitHub repository with sample code, go to

/wp-content/uploads/2016/02/sapnwabline_885687.png

Application Logging

In this video tutorial, see how to create, access and analyze application-related logs, container metrics and custom metrics in the Cloud Foundry environment. Philip shows how to access the Cloud Foundry application logging service and connect it to a running application before showing how to incorporate application logging into a multi-target application that also includes custom metrics.

/wp-content/uploads/2016/02/sapnwabline_885687.png

Storyboard

0:00 – Access application logs using SAP Cloud Platform cockpit > Application > [app] – Logs

0:50 – Access logs from command line:

cf logs [app] --recent

1:10 – Cloud Foundry Loggregator and Kibana Dashboard

1:50 – Service Marketplace: Application Logging

2:00 – Documentation SAP Cloud Platform Application Logging

2:30 – Create service instance and bind to application

3:15 – Restart application

3:30 – Kibana dashboard

4:10 – Integrate application logging service into application

4:45 – Add service to mta.yml

6:10 – Add package to package.json

6:30 – Add code to server.js

7:55 – Build and deploy

8:15 – Documentation Node.js Logging Support for Cloud Foundry [cf-nodejs-logging-support]

9:00 – Kibana dashboard

Code Samples

For the code samples used in this video tutorial, see the SAP HANA Academy on GitHub.

Learn More

For the service description, see the SAP Cloud Platform Discovery Center

For the documentation, see

SAP Cloud Platform Application Logging uses the Cloud Foundry loggregator and open-source Kibana dashboads. For more information, see

From the community

/wp-content/uploads/2016/02/sapnwabline_885687.png

Audit Logging

In this video tutorial, see how to access audit logs created in the Cloud Foundry environment. While the consumer of application logs is often a system administrator who would like to keep track of the state of a system, audit logs are read by an auditor. There are legal requirements (in some countries stricter than in others) regarding audit logging. Philip shows how to access the Cloud Foundry audit logging viewer application and how to access audit logs via the REST API using Postman and also a custom Node.js microservice.

/wp-content/uploads/2016/02/sapnwabline_885687.png

Storyboard

0:00 – Introducing audit logging

1:10 – Subscriptions audit log viewer

1:35 – Create role collection

2:35 – Auditlog viewer

3:00 – Rest API

3:20 – Create service instance for Auditlog Management

3:45 – Create service key

4:00 – Rest API credentials: client-id, clientsecret, URLs

4:20 – Create POST request in Postman with URL for authentication using basic authentication

/oauth/token?grant_type=client_credentials

5:10 – Returns access token

5:30 – Headers: Authorization = bearer <token>

auditlog-management.cfapps.us10.hana.ondemand.com/v2/auditlogrecords

6:00 – Params: time_from = [UTC]

6:30 – Documentation: api.sap.com/api/CFAuditLogRetrievalAPI/resource

6:50 – Using auditlog in application

7:00 – git clone of sample code for SAP Business Application Studio

7:30 – Code walkthrough: mta.yaml, server.js

8:10 – Build and deploy

8:30 – View results

Code Samples

For the code samples used in this video tutorial, see the SAP HANA Academy on GitHub.

Learn More

For the API information, visit the SAP API Business Hub

As documented

For more information about Postman, see

/wp-content/uploads/2016/02/sapnwabline_885687.png

Share and Connect 

Questions? Post as comment.

Useful? Give a like and share on social media. Thanks!

If you would like to receive updates, connect with me on

Best,

Denys van Kempen

/wp-content/uploads/2016/02/sapnwabline_885687.png

3 Comments
You must be Logged on to comment or reply to a post.
  • Hi Denys,

    Thanks for sharing this info. Is there a way to implement audit logging in a CAP application? Philip says in the video this is not supported but there’s an npm module provided by SAP that provides “audit logging functionalities for Node.js applications”.

    Cheers,

    Pierre

    • Hi Pierre,

      Well spotted and thanks for asking!

      Actually CAP already provides audit logging of relevant events out of the box – as do many other SAP provided services.

      What’s possible today is to read/view those audit logs either via the viewer or the REST API covered in the video tutorial.

      The audit-logging npm module is used internally by SAP provided applications but is not usable by partners and customers as the audit log service broker that this npm module connects to has not been made public.

      As for the future, it would be nice if partners and customers could add their own custom entries to the audit logs – however all I can do right now is point you to the SAP Road Map

      Thanks,

      Philip