---
title: "Audit Log"
description: "Track security-sensitive operations in RavenDB with audit logging that records authentication events, certificate usage, and admin actions."
url: "https://docs.ravendb.net/7.2/server/security/audit-log/audit-log-overview"
version: "7.2"
---

# Audit Log

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Audit Log

> **Note**
>
> - [Authorization](https://docs.ravendb.net/7.2/server/security/authorization/security-clearance-and-permissions.md) controls who can access RavenDB and what operations they can perform.
>
> - In addition, RavenDB provides an optional **Audit Log** to track who connects to the system and when.  
>   Audit logs are available only when using a secure server.
>
> - Audit entries are recorded for operations at the database level.  
>   See the full list of what is being logged below.
>
> - In this page:
>   - [Enabling the audit log](#enabling-the-audit-log)
>   - [What is being logged](#what-is-being-logged)
>   - [Things to consider](#things-to-consider)

## Enabling the audit log

- **To enable writing to the audit log**, set the following configuration key:
  - [Security.AuditLog.FolderPath](https://docs.ravendb.net/7.2/server/configuration/security-configuration.md#securityauditlogfolderpath) - set the path to a folder where RavenDB will store the audit logs.

- In addition, the following configurations are available:
  - [Security.AuditLog.ArchiveAboveSizeInMb](https://docs.ravendb.net/7.2/server/configuration/security-configuration.md#securityauditlogarchiveabovesizeinmb)  
    The maximum size an audit log file may reach before it is archived and logging is directed to a new file.
  - [Security.AuditLog.EnableArchiveFileCompression](https://docs.ravendb.net/7.2/server/configuration/security-configuration.md#securityauditlogenablearchivefilecompression) - determine whether to compress the audit log files.
  - [Security.AuditLog.MaxArchiveDays](https://docs.ravendb.net/7.2/server/configuration/security-configuration.md#securityauditlogmaxarchivedays) - the maximum number of days that an archived audit log file is kept.
  - [Security.AuditLog.MaxArchiveFiles](https://docs.ravendb.net/7.2/server/configuration/security-configuration.md#securityauditlogmaxarchivefiles) - the maximum number of archived audit log files to keep.
  - [Logs.ArchiveAboveSizeInMb](https://docs.ravendb.net/7.2/monitoring/logging/configuration.md#logsarchiveabovesizeinmb) - a new log file is created when this limit is reached (or daily).

- Learn how to set configuration keys in this [configuration overview](https://docs.ravendb.net/7.2/server/configuration/configuration-options.md).

## What is being logged

- Once the audit log is enabled, the following action items will be logged:
  - **Connecting to RavenDB**:  
    Every time a connection is made to RavenDB  
    Every time a connection to RavenDB is closed  
    When a connection is rejected by RavenDB as invalid  
    Adding a certificate + what privileges it was granted  
    Deleting a certificate  
    Opening a 2FA session  
    Failing to open a 2FA session
  - **Cluster**:  
    Adding a node to the cluster  
    Removing a node from the cluster
  - **Database**:  
    Creating or deleting a database  
    Modifying the database topology  
    Modifying the database record  
    Exporting or importing a database
  - **Indexes**:  
    Creating an index  
    Deleting an index  
    Resetting index
  - **Analyzers and sorters**:  
    Adding or deleting an analyzer  
    Adding or deleting a sorter
  - **Admin script**:  
    Executing an admin JS script
  - **Integrations**:  
    Setting or deleting a user from PostgreSQL protocol credentials.
  - **Connection strings**:  
    Adding or deleting a connection string
  - **Queries**:  
    Deleting documents via patching  
    Streaming query results from @all\_docs
  - **Revisions**:  
    Deleting revisions  
    Modifying revisions settings  
    Modifying revisions bin cleaner settings
  - **Ongoing tasks**:  
    Adding or updating an ETL task  
    Adding or updating a Kafka Sink or a RabbitMQ Sink task  
    Adding or updating External Replication task  
    Adding or updating Replication Hub or a Replication Sink task  
    Deleting any ongoing task  
    Toggling ongoing task state
  - **Backups**:  
    Adding a manual (one time) backup task  
    Adding, updating, or deleting a periodic backup task  
    Delaying the backup operation

## Things to consider

- **Audit log processing**:  
  RavenDB only writes to the audit logs without any additional processing.  
  The audit entries can be loaded into centralized audit and analysis systems using dedicated tools.

- **Audit logs are local**:  
  It is important to note that the audit logs are local.  
  For instance, if a database resides on node **C** and is removed by a command issued from node **B**,
  the corresponding audit entry will be recorded in the audit log of node **B**, not in that of node **C**.

- **Connection logging**:  
  RavenDB records connections in the audit log, not individual requests.
  Logging contains the time of the TCP connection, the certificate being used, and the level of access granted to that certificate at the time of the connection.
  This is done for performance and manageability; otherwise, the audit logs would become excessively large and difficult to manage.  
  With HTTP 1.1, a single TCP connection is utilized for multiple requests.  
  If you require more detailed logs at the level of individual HTTP requests, you can use a proxy in front of RavenDB to log the appropriate requests as they are made.
