# Event Configuration

## Configuration

Event Monitoring은 `Server.xml` 수정 또는 Web Console을 통해 설정 할 수 있습니다.

### Server.xml을 이용한 설정

Event Monitoring을 활성화 하기 위해서 `Server.xml`에 관련 설정을 추가합니다.

```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Server version="8">

 <Monitoring>
    <Events>
      <Level>info</Level>
      <Log>
        <Enabled>true</Enabled>
        <Path>/var/log/ovenmediaengine</Path>
      </Log>
    </Events>
  </Monitoring>

</Server>
```

<table><thead><tr><th width="201">Parameter</th><th width="93">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>&#x3C;Events>&#x3C;Level></code></td><td>N</td><td>Event Log는 동작에 따라 다른 레벨을 가지고 있습니다. 설정 가능한 값은 <code>trace</code>, <code>debug</code>, <code>info</code>, <code>warn</code>, <code>error</code> 이며 기본값은 <code>debug</code>입니다.</td></tr><tr><td><code>&#x3C;Events>&#x3C;Log>&#x3C;Enabled></code></td><td>Y</td><td><code>true</code>, <code>false</code>로 Event Log 기능을 활성화, 비활성화 할 수 있습니다.</td></tr><tr><td><code>&#x3C;Events>&#x3C;Log>&#x3C;Path></code></td><td>N</td><td>Event Log 파일이 저장되는 디렉토리를 지정합니다. 기본 디렉토리는 <code>/var/log/ovenmediaengine</code>입니다. </td></tr></tbody></table>

{% hint style="warning" %}
`Server.xml`을 수정한 경우 OvenMediaEngine 및 웹 콘솔 재시작이 필요합니다.
{% endhint %}

### Web Console을 이용한 설정

Web Console의 Server Settings 페이지에서 UI를 통해 Event Monitoring 기능을 활성화 할 수 있습니다.

<figure><img src="https://content.gitbook.com/content/Z6NWzeQyKbSWkDFSGwGx/blobs/3ILdu5VvQC9AYMzeY7dt/%EC%84%A4%EC%A0%95.JPG" alt=""><figcaption></figcaption></figure>

1. 화면 우측상단의 네비게이션을 이용해 Settings → Server 페이지에 진입합니다.
2. Monitoring 섹션에 설정 값을 세팅합니다.   \
   2-1. `level`: Event Log의 레벨을 설정합니다.   \
   2-2. `Log Enabled`: Evnet Log를 활성화 하기 위해 `true`로 설정합니다.   \
   2-3. `Log Path`: Event Log가 저장될 디렉토리를 설정합니다. 빈 값으로 설정하면 OvenMediaEngine의 기본 Log 저장 디렉토리인 `/var/log/ovenmediaengine` 내 `event.log`파일로 저장됩니다.
3. 설정 값들을 세팅한 후 상단의 `Update Changes`버튼을 클릭해 변경 사항을 적용합니다.

{% hint style="warning" %}
변경 사항을 적용하면 OvenMediaEngine이 자동 재시작 됩니다.
{% endhint %}

## Post Configuration

### Web Console Event Log 디렉터리 설정

{% hint style="success" %}
기본 설정값인 /var/log/ovenmediaengine 디렉토리를 사용하는 경우에는 별도의 설정이 필요하지 않습니다.
{% endhint %}

기록된 Event Log를 Web Console과 동기화 하기 위해서는 설정된 `LogPath`와 Web Console의 환경 변수를동일하게 맞춰야 합니다.

[system.env](https://ovenmediaengine-enterprise.gitbook.io/guide/ko-kr/web-console/getting-started-with-web-console)에 환경 변수를 추가하여 변경한 Event Log 디렉토리를 설정할 수있습니다.

<pre><code><strong>OS_ENGINE_MONITORING_EVENT_PATH=/your/eventlog/directory
</strong></code></pre>

### Event Specification

Event Log로 기록되는 Event 형식 및 Evnet 목록의 상세 내용을 확인하려면 [Event Specification](https://ovenmediaengine-enterprise.gitbook.io/guide/ko-kr/web-console/web-console-overview/event-monitoring/event-specification) 문서를 참조하시기 바랍니다.
