# Event administration (IRPCEventsAdmin)

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/

Reads, exports and deletes the vault's event log, turns event logging on or off, and stores the
caller's saved event log filters.

MFAdmin uses this interface to admininistrate events.

- **gRPC service:** `MFiles.IRPCEventsAdmin`
- **Book and level:** [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md), specialized
- **Methods:** 13
- **Proto file:** [`mfiles/IRPCEventsAdmin.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/IRPCEventsAdmin.proto)

<a id="overview"></a>

## Overview

M-Files Admin uses this service for the vault's event log: viewing, exporting and clearing it.
Every method needs a vault session and the vault right `manage_events` (part of full control);
a normal user gets "Access denied." (0x800407E4 with reason 0x800400A9).

- **Logging on or off**:
  [IsEventLoggingEnabled](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/IsEventLoggingEnabled/index.md),
  [EnableEventLogging](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/EnableEventLogging/index.md).
- **Read events** ([Event](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Event/index.md)): find the ID range with
  [GetMinAndMaxEventIDs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetMinAndMaxEventIDs/index.md), then read pages with
  [GetEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventsRange/index.md).
- **Export and delete**: after saving the events elsewhere, record the export with
  [EventsExported](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/EventsExported/index.md) and remove them with
  [DeleteEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventsRange/index.md);
  [ClearEvents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/ClearEvents/index.md) removes all events.
- **Saved filters** of the event log viewer, private to each user:
  [SaveEventLogFilter](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/SaveEventLogFilter/index.md),
  [GetEventLogFilters](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventLogFilters/index.md),
  [DeleteEventLogFilters](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventLogFilters/index.md),
  [GetEventLogFilterRecord](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventLogFilterRecord/index.md),
  [UpdateEventLogFilterDefaultValue](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/UpdateEventLogFilterDefaultValue/index.md).

**Client version.** [GetEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventsRange/index.md) and
[GetEvents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEvents/index.md) fail with "The installed M-Files client
version is older than the M-Files Server version." (0x80040930) unless the session was opened
with `client_data.version` 12.0.5192.0 or newer. Log in with `client_data.version` set to the
`server_version` from [QueryVersion](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCQueryVersion/QueryVersion/index.md).

**-1 means "no filter".** Event ID bounds and object filters use -1 for "not set". The proto3
default 0 is a real value: a request left at its defaults matches no events.

**Advanced event log features** (21 CFR Part 11 compliance): when they are enabled in the vault,
event logging cannot be turned off and [ClearEvents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/ClearEvents/index.md)
is refused; [DeleteEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventsRange/index.md) still works.

<a id="methods"></a>

## Methods

| Method | Summary | Facts |
|---|---|---|
| [ClearEvents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/ClearEvents/index.md) | Deletes all events of the vault. | `admin` `session` |
| [DeleteEventLogFilters](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventLogFilters/index.md) | Deletes saved event log filters of the calling user by ID. | `admin` `session` `idempotent` |
| [DeleteEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/DeleteEventsRange/index.md) | Deletes the events whose IDs are in the given range. | `admin` `session` |
| [EnableEventLogging](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/EnableEventLogging/index.md) | Turns event logging of the vault on or off. | `admin` `session` `idempotent` |
| [EventsExported](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/EventsExported/index.md) | Records in the event log that a range of events was exported. | `admin` `session` |
| [GetEventLogFilterRecord](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventLogFilterRecord/index.md) | Gets the conditions of the calling user's default event log filter. | `admin` `session` `idempotent` |
| [GetEventLogFilters](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventLogFilters/index.md) | Gets the event log filters saved by the calling user. | `admin` `session` `idempotent` |
| [GetEvents](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEvents/index.md) | Gets all events of the vault. | `admin` `session` |
| [GetEventsRange](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetEventsRange/index.md) | Gets events by ID range and filters, oldest or newest first, with an optional maximum count. | `admin` `session` `idempotent` |
| [GetMinAndMaxEventIDs](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/GetMinAndMaxEventIDs/index.md) | Gets the smallest and largest event ID in the vault's event log. | `admin` `session` |
| [IsEventLoggingEnabled](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/IsEventLoggingEnabled/index.md) | Tells whether event logging is on in the vault. | `admin` `session` `idempotent` |
| [SaveEventLogFilter](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/SaveEventLogFilter/index.md) | Saves a named event log filter for the calling user. | `admin` `session` `idempotent` |
| [UpdateEventLogFilterDefaultValue](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventsAdmin/UpdateEventLogFilterDefaultValue/index.md) | Makes a saved event log filter the user's default filter, or clears its default flag. | `admin` `session` `idempotent` |
