# Auditing

With auditing you can keep track of who did what and when. Think of login/logout events, data access events, failed authentications, etc. Below you will read how to configure auditing in your MOLGENIS.

## Configuring the log file

If you want to log auditing information to a log file, you'll need to set the `audit.log.path` environment variable and point it to where you want to store the log file. For developers using IntelliJ, see the [Tomcat guide](https://github.com/molgenis/molgenis/tree/0010f8f307c8071b6d41dfc4b6159d2291158595/docs/guide-using-an-ide-for-backend/README.md#deploy-run-in-tomcat-server).

## Auditing settings

The settings for auditing can be found in the Settings plugin.

### Audit system entity types

Audit logging for system entity types can be enabled or disabled. When enabled, all *changes* to system entity types will be logged: create, update and delete. Read events won't be logged.

### Audit non-system entity types

Audit logging for non-system entity types (like imported datasets) can be configured with this setting. Your options are:

* **None** - no entity types will be audited
* **Tagged** - only entity types with the `audit-usage` tag will be audited (see below)
* **All** - all entity types will be audited

When enabled, all interactions with these entity types will be logged, including read events.

## Tagging an entity type

With tags, you have fine-grained control over which entity types are audited. Here's how you can tag your entity types:

### In MOLGENIS

1. Go to the Data Explorer
2. Navigate to the `Entity type` table
3. Look for the entity type you want to audit
4. Edit it, and find the `Tags` field
5. Here, add the `audit-usage` tag

### In EMX

1. Go to the `entities` sheet
2. Add `audit-usage` in the `tags` column for every entity type that should be audited
3. Import the EMX


---

# 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://molgenis.gitbook.io/molgenis/9.0/configuration/guide-auditing.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.
