Skip to content

SAP Cloud Logging

Store and analyze application logs, metrics, and traces based on OpenSearch.

SAP Cloud Logging service is an instance-based observability service that builds upon OpenSearch to store, visualize, and analyze application logs, metrics, and traces from SAP BTP Cloud Foundry, Kyma, Kubernetes and other runtime environments. For Cloud Foundry and Kyma, it offers an easy integration by providing predefined contents to investigate load, latency, and error rates of the observed applications based on their requests and correlate them with additional data. From Application Logging to Cloud Logging: Service Innovation Guide

SAP Cloud Logging
FeatureDescription
Store observability dataStore observability data from SAP BTP workloads. Ingest logs, metrics, and traces via OpenTelemetry format API. Ingest observability data via JSON format API. Ingest application logs and request logs emitted by Cloud Foundry.
Configure retentionPersist the ingested observability data for a configurable retention period. Note: This is overruled by size-based curation when the disk runs full.
View, search, and analyze dataView, search, filter, and analyze observability data in a web-based user interface using predefined dashboards.
Create custom dashboardsBuild and persist custom dashboards to analyze your observability data tailored to your specific requirements.
Configure notificationsConfigure customized notifications derived from the observability data of your applications.
Manage accessEnable management of users and group-based access using SAP Identity Authentication Service.

How to get started?

Find relevant SAP Community Blogs.

Cloud Logging vs Application Logging (deprecated)

🚧 = Roadmap

Feature / CapabilitiesCloud LoggingApplication Logging
🔹 SAP BTP Runtimes
Cloud Foundry
Kyma
Other (public endpoints)
Cross-runtime
🔹 Signal Types
Logs
Metrics (custom)
Cloud Foundry container metrics🚧
Traces
🔹 Ingest Sources
Cloud Foundry
Kyma
Other (public endpoints)
🔹 Ingest Endpoints
CF Syslog over https (RFC5424 Syslog)
Json (https)
Open Telemetry (grpc)
Open Telemetry (https)🚧
🔹 Dashboarding
Cloud Foundry (pre-build)
Kyma (pre-build)
Open Telemetry (pre-build)
Custom Dashboards
🔹 Features
Alerting
Anomaly Detection
Logging Libraries
Instance Labelling
🔹 Storage
Custom Retention Period
fixed 7 days
Autoscaling Storage
Autoscaling Ingest
Disk compression🚧
🔹 Authentication /Authorization
Cloud Foundry UAA
SAML Integration
OIDC🚧
Fine-grained access-management
Mask sensitive fields
🔹 Integrations
SAP Cloud ALM
Alert Notification service

AppRouter Extension @sap/approuter @sap/logging

js
const logging = require('@sap/logging');

// create SAP Logging Context
const sapLogging = logging.createLogger({ name: 'approuter' });
const sapMiddleware = logging.expressMiddleware();

function requestLogger(req, _res, next) {
  // important! mask sensible header data
  const { authorization, cookie, ...safeHeaders } = req.headers;

  const logEntry = {
    written_at: new Date().toISOString(),
    level: 'INFO',
    component: 'request',
    method: req.method,
    url: req.originalUrl,
    headers: safeHeaders,
    query: req.query,
    body: req.body // needs body-parser
  };

  // -> stdout for SAP Cloud Logging
  console.log(JSON.stringify(logEntry));

  // correlation for follow up services
  const context = req.loggingContext.getContext();
  context.setCustomField('request', logEntry);

  next();
}

module.exports = { sapMiddleware, requestLogger };

Support

Component NameComponent Description
BC-CP-CLSSupport component for this service