# Audit logs

## Akamas audit logs

Akamas stores all its logs into an internal Elasticsearch instance: some of these logs are reported to the user in the GUI in order to ease the monitoring of workflow executions, while other logs are only accessible via CLI and are mostly used to provide more context and information to support requests.

Audit access can be performed by using the CLI in order to extract logs related to UI or API access. For instance, to extract audit logs from the last hour use the following commands:

* UI Logs

```bash
akamas logs --no-pagination -S kong -f -1h
```

* API Logs

```bash
akamas logs --no-pagination -S kong -f -1h
```

Notice: to visualize the system logs unrelated to the execution of workflows bound to workspaces, you need an account with administrative privileges.

## Storing audit logs into files <a href="#auditlogging-accessfilelogs" id="auditlogging-accessfilelogs"></a>

To ease the integration with external logging systems, Akamas can be configured to store access logs into files. To enable this feature you should:

1. Create a `logs` folder next to the Akamas `docker-compose.yml` file
2. Edit the `docker-compose.yml` file by modifying the line `FILE_LOG: "false"` to `FILE_LOG: "true"`
3. If Akamas is already running issue the following command

```bash
docker compose up -d logstash
```

otherwise, start Akamas first.

When the user interacts with the UI or the API Akamas will report detailed access logs both on the internal database and in a file in the `logs` folder. To ease log rolling and management every day Akamas will create a new file named according to the pattern `access-%{+YYYY-MM-dd}.log`.


---

# Agent Instructions: 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:

```
GET https://docs.akamas.io/akamas-docs/3.4.0/managing-akamas/audit-logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
