---
title: Working with the system event log
related:
  - https://docs.kentico.com/13/custom-development/customizing-event-logging.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The event log stores information about all events that occur in the system. It is useful to view logged information if unwanted behavior occurs in the system and you want to find out where the problem originates or get additional details.

## Viewing the event log

To view the event log, open the **Event log** application.

![Viewing the event log](https://docs.kentico.com/docsassets/13/working-with-the-system-event-log/Event_Log.png "Viewing the event log")

If you click **Display event** () next to an event, the system displays a dialog with full details about the event.

## Configuring the event log

You can configure the following event log settings:

### General event log settings

You can configure the following settings for the event log in **Settings -> System**:

| Setting location            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Event log size              | Limits the maximum number of events stored in the Event log.<br>When exceeded by 10% (or a different percentage set by means of the **CMSLogKeepPercent** web.config key), the percentage of the oldest events is deleted from the log in a batch.<br>Old events that exceed the limit are not deleted immediately, but only after a new event is logged.<br>Applies separately to site-specific events for each site and global events. For example, if you set the limit to 100, the log may contain 110 site-specific events for each site in the system, and 110 global events.<br>Set to 0 if you do not want the system to log any events. |
| Log metadata changes        | If enabled, changes of object and page metadata (i.e. when an object or a page is created, edited or deleted) are logged in the Event log.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Log to database             | Indicates if events are logged to database. Does not override Event log size set to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Log to filesystem           | If enabled, the system writes the Event log into the _**CMS\App\_Data\logEvents.log**_ file on the server's file system. Does not override Event log size set to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Log to trace                | Indicates if events are logged to trace. Does not override Event log size set to 0.<br>See: [Logging system events to trace](#logging-system-events-to-trace)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Use EventLog trace listener | Indicates if the system logs events in your Windows Event Viewer.<br>Use the Modify feature of the installer, if you have not enabled the _Registration of Xperience in Windows Event Log_ option during your installation.<br>See: [Logging system events in the Windows Event Viewer](#logging-system-events-in-the-windows-event-viewer)                                                                                                                                                                                                                                                                                                      |

> **Tip:** You can also configure the Event log by adding keys to the _appSettings_ section of your application's _web.config_ file. The keys work in combination with the settings listed above. For more information, see [Reference - Web.config application keys](https://docs.kentico.com/13/configuring-xperience/reference-web-config-application-keys.md#event-log-settings).

### Configuring permissions for the event log

To allow users to work with the event log, [configure permissions](https://docs.kentico.com/13/managing-users/configuring-permissions.md) for your website's [roles](https://docs.kentico.com/13/managing-users/role-management.md):

1. Open the **Permissions** application.
2. Select permissions for **Modules** and the **Event log**.
3. Assign the following permissions to roles:

   - **Read** – allows members of the roles to access the event log. Only users with the Global administrator [privilege level](https://docs.kentico.com/13/managing-users/user-management.md) can view events logged on a global application level.
   - **Clear log** – allows members of the roles to delete the records in the event log.

### Logging system events to trace

You can set up the system to log application events in trace. You can then implement your own listener, such as the [TextWriterTraceListener](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.textwritertracelistener) or use the out-of-the-box Xperience functionality to log events into the [Windows Event Viewer](#logging-system-events-in-the-windows-event-viewer).

To enable logging of system events to trace:

1. In the Xperience administration interface, open the **Settings** application.
2. Select the **System** category.
3. In the **Event log** settings group, enable **Log to trace**.
4. **Save** the changes.

The system now logs events to trace. You can now implement your own listener, such as the [TextWriterTraceListener](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.textwritertracelistener).

### Logging system events in the Windows Event Viewer

You can set up the system to log events in the Windows Event Viewer. This is achieved using the [EventLogTraceListener](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlogtracelistener).

> **Note:** **Requirements for IIS 8.5 and newer**
>
> If your website is hosted on IIS 8.5 or newer, you need to enable sending of logging information to Event Tracing for Windows (ETW). For more information, see the [Logging to Event Tracing for Windows in IIS 8.5](https://docs.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/logging-to-etw-in-iis-85) article (select the **ETW event only** or **Both log file and ETW event** option for the **Log Event Destination** in IIS).

#### Registering Xperience in the Windows Event Log

1. Run the installer.
2. Select your country, accept the license agreement, and click **Next**.
3. **Modify** the installation that you want to register in **Windows Event Log**.
4. Select the **Registration of Xperience in Windows Event Log** check box.
5. **Apply Changes**.

The installer registers Xperience in the Windows Event Log.

#### Enabling logging of events into Windows Event Log

1. In the Xperience administration interface, open the **Settings** application.
2. Select the **System** category.
3. In the **Event log** settings group, enable **Log to trace** and **Use EventLog trace listener**.
4. **Save** the changes.

The system now logs events to both the event log and Windows Event Viewer.

### Setting up email notifications for errors

You can configure the system to automatically send email notifications whenever errors occur in the application.

1. Open the **Settings** application.
2. Select the **System** category.
3. Enter the target email addresses for the notifications into the **Error notification email address** setting.
   - Use semicolons to separate multiple addresses.
4. Type a sender address into the **No-reply email address** settings.
   - The notification emails use the sender address in their _From_ field.
5. **Save** the settings.

## Event log API

You can find an API example of logging events into the event log in [Designing secure error messages](https://docs.kentico.com/13/securing-websites/developing-secure-websites/handling-error-messages-securely/designing-secure-error-messages.md#storing-the-debug-and-trace-information-in-the-event-log). More examples are provided in the [API Examples documentation](https://docs.kentico.com/13api.md).

## Customizing event logging

If you wish to customize the way the system logs events, see [Customizing event logging](https://docs.kentico.com/13/custom-development/customizing-event-logging.md).
