# IRPCEventLog.AddCustomEventEntry

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Event log](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventLog/index.md)

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

Badges: `Vault API / standard` `write` `session`

Adds a custom entry to the vault's event log and returns its event ID.

- **Service:** [Event log](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventLog/index.md) `MFiles.IRPCEventLog`
- **gRPC method:** `/MFiles.IRPCEventLog/AddCustomEventEntry`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-custom-event-entry`
- **Request:** [`AddCustomEventEntryRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventLog/AddCustomEventEntry/index.md#request)
- **Response:** [`AddCustomEventEntryResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCEventLog/AddCustomEventEntry/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** no
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- Requires the vault right `generate_event_logs`; otherwise the call fails with an access
  denied error.
- The entry is recorded as a custom event with the current time and the calling user's account
  and name.
- The event data is stored as a `customevent` XML element whose `customeventtype` attribute is
  `event_type`. If `xml_data` is well-formed XML, its root element becomes a child of that
  element; any other text is stored as the element's text value.
- When event logging is disabled in the vault, nothing is written and `event_id` is 0.
- Not idempotent: every successful call adds a new entry.

<a id="request"></a>

## Request: AddCustomEventEntryRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `event_type` | `string` | An identifier of your choice for the kind of event, for example `"MyApp.ContractApproved"`. Stored as the `customeventtype` attribute of the entry. |
| `xml_data` | `string` | The event data: either an XML document (stored as XML) or plain text (stored as text). May be empty. |

<a id="response"></a>

## Response: AddCustomEventEntryResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `event_id` | `int64` | The ID of the new event log entry, or 0 if event logging is disabled. |
