Technical Articles
SAP BTP Developer Onboarding III | Hands-on Video Tutorials
UPDATE: May 2022 The onboarding series has been updated. For the latest version, visit The information presented in this blog is no longer current. |
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
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.
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 | SAP Cloud Platform
- Node.js Logging Support for Cloud Foundry [cf-nodejs-logging-support]
SAP Cloud Platform Application Logging uses the Cloud Foundry loggregator and open-source Kibana dashboads. For more information, see
- Loggregator Architecture | Cloud Foundry
- Kibana
From the community
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.
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
Share and Connect
Questions? Please post as comment.
Useful? Give us a like and share on social media.
Thanks!
If you would like to receive updates, connect with me on
- LinkedIn > linkedin.com/in/dvankempen
- Twitter > @dvankempen
For the author page of SAP PRESS, visit
Over the years, for the SAP HANA Academy, SAP’s Partner Innovation Lab, and à titre personnel, I have written a little over 300 posts here for the SAP Community. Some articles only reached a few readers. Others attracted quite a few more.For your reading pleasure and convenience, here is a curated list of posts which somehow managed to pass the 10k-view mile stone and, as sign of current interest, still tickle the counters each month. |
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
Hi Philip,
Audit logging is "planned" in the CAP feature list so I hope it will be available in the not-too-distant future. We definitely need this in our industry (biotech).
Pierre
Hello Philip,
Custom domain setup videos in Youtube are set to Private, can this be made publicly available? I know these videos were available for public sometime back but that is not the case anymore.
Thanks in advance.
Yoganand.V
Hi Yoganand,
The video series was updated. See
https://blogs.sap.com/2022/04/29/sap-btp-developer-onboarding-2022-hands-on-video-tutorials/
(banner added)
Hello Denys,
Thanks for the update, I have checked the playlist you have added to the blog but I was looking for the 4 part series on Custom Domain as shown in the below screenshot. These videos were available for public few months back but now they seem to be set to Private.
SAP BTP - Custom Domain video series
Thanks.
Yoganand.V
These video tutorials should be visible again via the blog. Thanks.