com.sap.cds:cds-feature-auditlog-ng
A CAP Java plugin that sends audit log events to the SAP Audit Log serviceSAP Audit Log serviceIngests compliance audit data from BTP services and applications and keeps it for ninety days by default; retrieval and longer retention are separate services.sap official, btp in the format the Audit Log Event Catalog expects.
Emits audit log events from a CAP Java application to the SAP Audit Log serviceSAP Audit Log serviceIngests compliance audit data from BTP services and applications and keeps it for ninety days by default; retrieval and longer retention are separate services.sap official, btp: personal data access, personal data modification, configuration change and security events, each matched to the Audit Log Event Catalog's semantics. The Maven dependency cds-feature-auditlog-ng runs against a user-provided service instance for SAP Audit Log service bound in the application's Cloud Foundry space; local testing loads the same credentials from a default-env.json file instead. The namespace an event carries defaults to the one in the service binding, and can be overridden per event with the auditlog.namespace payload key, a value that survives outbox serialisation; the service rejects an event naming a namespace that was never registered.
Facts
Where it sits
Who is behind it
In the atlas: maintains 10@cap-javamaintainerAndreas WehrmannContributes to this
In the atlas: contributes to 1@andwehrmBraunMatthiasContributes to this
In the atlas: contributes to 8@BraunMatthiasGuilherme DellagustinContributes to this
In the atlas: contributes to 27@dellagustin-sapgeorgi-shakevContributes to this
In the atlas: contributes to 1@georgi-shakevMiroslav TsvetanovContributes to this
In the atlas: contributes to 2@mtsvetanov071Marvin LContributes to this
In the atlas: contributes to 7@SchmarviniussimeongelovskiContributes to this
In the atlas: contributes to 2@simeongelovskisjvansContributes to this
In the atlas: contributes to 45@sjvans8 contributors
What it declares
Every artifact
- Type
- Package
- Origin
- By SAP
- Runtime
- Java
As a package
- Where it runs
- Inside its host
- Distributed through
- Maven
Connections
Recording who touched personal or sensitive data, for auditors
Ingests and retains compliance audit data from BTP
Ingests and retains compliance audit data from BTP
Download
Where it sits in your app
Download
README
quoted from cap-java/cds-feature-auditlog-ng under Apache-2.0, readCDS plugin for SAP Audit Log service
About this project
The CDS plugin for SAP Audit Log service enables Java CAP applications to emit audit log events in a standardized way. It is fully compatible with the Audit Log Event Catalog, ensuring standardized event semantics and compatibility.
You can emit the following types of audit log events:
- Personal Data Access Event
- Personal Data Modification Event
- Configuration Change Event
- Security Event
Official CAP documentation can be found here.
Testing
For both local and cloud testing, refer to the cloud-cap-samples-java repository and follow the instructions provided in its README.
For local testing, make sure to create a default-env.json file at the root of your project. This file should contain the following content:
{
"VCAP_SERVICES": {
"application-logs": [
{
"binding_guid": "binding_guid",
"binding_name": null,
"credentials": {},
"instance_guid": "instance_guid",
"instance_name": "cf-logging",
"label": "application-logs",
"name": "cf-logging",
"plan": "lite",
"provider": null,
"syslog_drain_url": null,
"tags": [],
"volume_mounts": []
}
],
"user-provided": [
{
"binding_guid": "binding_guid",
"binding_name": null,
"credentials": {
"url": "als-endpoint",
"region": "als-region",
"namespace": "registered namespace",
"cert": "-----BEGIN CERTIFICATE-----...-----END CERTIFICATE-----",
"key": "-----BEGIN PRIVATE KEY-----...-----END PRIVATE KEY-----",
"passphrase": "private key pass phrase"
},
"instance_guid": "instance_guid",
"instance_name": "auditlog-ng",
"label": "user-provided",
"name": "auditlog-ng",
"syslog_drain_url": null,
"tags": [
"auditlog-ng"
],
"volume_mounts": []
}
]
},
"VCAP_APPLICATION": {
"application_id": "application_id",
"application_name": "bookshop-srv",
"application_uris": [
"application_uris"
],
"cf_api": "cf_api",
"limits": {
"fds": 32768
},
"name": "bookshop-srv",
"organization_id": "organization_id",
"organization_name": "organization_name",
"space_id": "space_id",
"space_name": "space_name",
"uris": [
"application_uris"
],
"users": null
}
}
This file simulates the Cloud Foundry environment variables required for your application to run locally.
Requirements and Setup
To get your project running, ensure you have the following prerequisites:
- Java 17 or higher installed
- A user-provided service instance for SAP Audit Log service created in your Cloud Foundry space
- The Maven dependency for
cds-feature-auditlog-ngadded to your project
Dynamic Namespace Selection (Optional)
By default, the namespace used in audit log events is taken from the service binding credentials. This is sufficient for most applications.
Optional: For applications that need to route audit events to different namespaces, the namespace can be overridden per-event using the payload.
Payload-based Namespace
Set the namespace directly in the event payload using the key auditlog.namespace. This approach survives transactional outbox serialization, ensuring the custom namespace is preserved even when events are processed asynchronously through the outbox.
Important: The key must be exactly
"auditlog.namespace". You can also use the constantAuditLogNG.NAMESPACE_ATTRIBUTE.
Examples
// Security Event
SecurityLog securityLog = SecurityLog.create();
securityLog.setAction("login");
securityLog.setData("User logged in");
securityLog.put("auditlog.namespace", "my-custom-namespace");
auditLogService.logSecurity(securityLog);
// Data Access Event
DataAccessLog dataAccessLog = DataAccessLog.create();
dataAccessLog.setAccesses(List.of(access));
dataAccessLog.put("auditlog.namespace", "my-custom-namespace");
auditLogService.logDataAccess(dataAccessLog);
// Config Change Event
ConfigChangeLog configChangeLog = ConfigChangeLog.create();
configChangeLog.setConfigurations(List.of(configChange));
configChangeLog.put("auditlog.namespace", "my-custom-namespace");
auditLogService.logConfigChange(configChangeLog);
// Data Modification Event
DataModificationLog dataModificationLog = DataModificationLog.create();
dataModificationLog.setModifications(List.of(modification));
dataModificationLog.put("auditlog.namespace", "my-custom-namespace");
auditLogService.logDataModification(dataModificationLog);
Resolution Priority
The namespace is resolved in the following order:
- Payload:
payload.get("auditlog.namespace") - Service binding: Namespace from the service binding credentials
Behavior
| Scenario | Namespace Used |
|---|---|
auditlog.namespace set in payload | Custom namespace from payload |
| Namespace is empty or whitespace-only | Falls back to service binding |
| No custom namespace set | Namespace from service binding |
Note: The custom namespace value is trimmed of leading/trailing whitespace before use.
Error Handling
If you specify a custom namespace that is not registered in the SAP Audit Log service, the service will reject the event with a 403 Forbidden error. Ensure all custom namespaces are properly registered before use.
Support, Feedback, Contributing
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
Security / Disclosure
If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
Code of Conduct
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Licensing
Copyright 2025 SAP SE or an SAP affiliate company and cds-feature-auditlog-ng contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
History
Features 1
Notes
Added
- Support for dynamic namespace selection via event payload (
AuditLogNG.NAMESPACE_ATTRIBUTE)
Others providing
Compare all 6 on the Audit logging page →- SAP Audit Log serviceSAP Audit Log serviceIngests compliance audit data from BTP services and applications and keeps it for ninety days by default; retrieval and longer retention are separate services.sap official, btpIngests and retains compliance audit data from BTPfrom BTP/BAIP
- com.sap.cds:cds-feature-auditlog-v2com.sap.cds:cds-feature-auditlog-v2The CAP Java handler that sends the SDK's AuditLog events to the SAP Audit Log service over its API version 2, once a service binding is present.sap official, capCAP Java handler for SAP Audit Log service API version 2from CAP
- com.sap.cds:cds-services-bomcom.sap.cds:cds-services-bomThe Maven bill of materials for CAP Java, pinning every com.sap.cds module in a release, from the API and core runtime to the Spring Boot starters and the CQN engine, to the same version.sap official, capMaven bill of materials pinning CAP Java module versionsfrom CAP
- @cap-js/audit-logging@cap-js/audit-loggingIntegration with the SAP Audit Log service, so operations on personal data are recorded in the form an auditor expects without the application writing the entries.sap official, capCAP integration with the SAP Audit Log servicefrom CAP
- s4hana-hana-audit-policiess4hana-hana-audit-policiesSQL templates for the SAP HANA audit policies of the database tenant an SAP S/4HANA system uses, in four sets from the mandatory default policies to scenario examples.sap official, btpSQL templates for HANA audit policies of an S/4HANA tenantfrom BTP/BAIP
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Flavors
“This artifact is a CAP Java plugin that provides out-of-the box SAP Audit Log NG Service.” — com.sap.cds:cds-feature-auditlog-ng-root — POM
Contributors
History in the atlas
- The second reader read the connects batch of 2026-09-19 on 2026-09-22, after its acceptance, and found: the for sentence names the Audit Log Event Catalog from a passage the edge did not cite; it is cited now.
- Handles the four CAP audit log event types and sends them to the SAP Audit Log service, matching the Audit Log Event Catalog's semantics so downstream tooling reads standard events.
- The plugin required the Audit Log service; the connection says which way the events go.
- First seen.
For your agent
- Ref
artifact:cap-java-cds-feature-auditlog-ng- JSON
- /artifacts/cap-java-cds-feature-auditlog-ng.json
- MCP
- Connecting an agent