> For the complete documentation index, see [llms.txt](https://docs.turium.ai/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.turium.ai/home/algoreus/turium-connector-documentation/turium-fabriq-overview/how-to-guides/engram-metadata-user-guide/audit-logging.md).

# Audit Logging

* [Supported Audit Events](#supported-audit-events)
* [Configuring Audit Publishing](#configuring-audit-publishing)
* [Consuming Audit Events](#consuming-audit-events)
  * [Dataset Creation](#dataset-creation)
  * [Application Metadata Change](#application-metadata-change)

Audit logging provides a chronological record showing proof of operations or alterations on Algoreus entities. This record can be used to track the set of actions that defined the state of an entity at a certain point in time. These actions involve the creation, alteration, and deletion of an entity, as well as the changes made to the entity's metadata. For data entities (datasets), it includes access information that's used to generate the entity's lineage.

***

### Supported Audit Events <a href="#supported-audit-events" id="supported-audit-events"></a>

Algoreus  supports the following audit events:

| Audit Event Type | Supported Entities                          |
| ---------------- | ------------------------------------------- |
| CREATE           | Datasets                                    |
| UPDATE           | Datasets                                    |
| DELETE           | Datasets                                    |
| TRUNCATE         | Datasets                                    |
| ACCESS           | Datasets                                    |
| METADATA\_CHANGE | Applications, Artifacts, Datasets, Programs |

***

### Configuring Audit Publishing <a href="#configuring-audit-publishing" id="configuring-audit-publishing"></a>

The properties set in the algoreus-site.xml control audit publishing:

* `audit.enabled`: This determines whether the publishing of audit logs is enabled. By default, this is set to true.
* `audit.topic`: This sets the topic to publish to. By default, this is set to audit.

***

### Consuming Audit Events <a href="#consuming-audit-events" id="consuming-audit-events"></a>

When audit publishing is enabled, for each audit event, a message is sent to Algoreus Algo Connect on the configured topic.

The contents of the message are a JSON representation of the `AuditMessage` class.

Here are some example JSON messages, formatted for readability:

#### Dataset Creation <a href="#dataset-creation" id="dataset-creation"></a>

```json
{
        "version": 1,
        "time": 1000,
        "entityId": {
                "namespace": "ns1",
                "dataset": "ds1",
                "entity": "DATASET"
        },
        "user": "user1",
        "type": "CREATE",
        "payload": {}
}
```

#### Application Metadata Change <a href="#application-metadata-change" id="application-metadata-change"></a>

```json
{
        "version": 1,
        "time": 3000,
        "entityId": {
              "namespace": "ns1",
              "application": "app1",
                "entity": "APPLICATION"
        },
        "user": "user1",
        "type": "METADATA_CHANGE",
        "payload": {
                "previous": {
                      "USER": {
                              "properties": {
                                      "uk": "uv",
                                      "uk1": "uv2"
                                },
                                "tags": ["ut1", "ut2"]
                        },
                        "SYSTEM": {
                                "properties": {
                                        "sk": "sv"
                                },
                                "tags": []
                        }
                },
                "additions": {
                        "SYSTEM": {
                                "properties": {
                                        "sk": "sv"
                                },
                                "tags": ["t1", "t2"]
                        }
                },
                "deletions": {
                        "USER": {
                                "properties": {
                                        "uk": "uv"
                                },
                                "tags": ["ut1"]
                        }
                }
        }
}
```

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.turium.ai/home/algoreus/turium-connector-documentation/turium-fabriq-overview/how-to-guides/engram-metadata-user-guide/audit-logging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
