Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update audit-log presets #1446

Merged
merged 7 commits into from
Nov 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions guides/data-privacy/audit-logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ npm add @cap-js/audit-logging
{
"audit-log": {
"handle": [ "READ", "WRITE" ],
"outbox": true
"[development]": {
"impl": "@cap-js/audit-logging/srv/audit-log-to-console",
"outbox": false
"impl": "@cap-js/audit-logging/srv/log2console"
},
"[hybrid]": {
"impl": "@cap-js/audit-logging/srv/log2restv2",
"vcap": { "label": "auditlog" }
},
"[production]": {
"impl": "@cap-js/audit-logging/srv/audit-log-to-restv2",
"outbox": true
"impl": "@cap-js/audit-logging/srv/log2restv2",
"vcap": { "label": "auditlog" }
}
}
}
Expand All @@ -65,7 +69,7 @@ npm add @cap-js/audit-logging
- `outbox` — whether to use transactional outbox or not
- `handle` — which events (`READ` and/or `WRITE`) to intercept and generate log messages from

**The preset uses profile-specific configurations** for development and production. Use the `cds env` command to find out the effective configuration for your current environment:
**The preset uses profile-specific configurations** for (hybrid) development and production. Use the `cds env` command to find out the effective configuration for your current environment:

::: code-group
```sh [w/o profile]
Expand Down Expand Up @@ -486,13 +490,12 @@ This provides an ultimate level of resiliency, plus additional benefits:

- **False log messages are avoided** — messages are forwarded to the audit log service on successfully committed requests; and skipped in case of rollbacks.

This transparently applies to all implementations, even [custom implementations](#custom-implementation). You can opt out of this default by configuring outbox: false in the configuration, for example, as we do in the default configuration for development:
This transparently applies to all implementations, even [custom implementations](#custom-implementation). You can opt out of this default by configuring outbox: false in the configuration, for example, as shown in the following snippet for profile `development`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using this format instead of the code block?
image


```json
{
"audit-log": {
"[development]": {
"impl": "@cap-js/audit-logging/srv/audit-log-to-console",
"outbox": false // [!code focus]
}
}
Expand Down