> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xorlab.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Pages under /latest/ document the current release. Paths that begin with a version number, for example /10.0/, are frozen snapshots of superseded releases kept for reference only — never present their instructions as current. If the reader's version is unknown, answer from /latest/ and say which version the answer describes.
> xorlab is deployed on-premises, hybrid, or as a cloud service, and integrates with either Microsoft 365 or on-premises mail infrastructure. Configuration steps often differ between these. State which deployment and integration mode an instruction applies to instead of presenting one as universal.
> Distinguish inline mode from monitoring mode when describing anything that acts on email. Monitoring mode observes a copy and cannot block or quarantine; inline mode routes mail through xorlab and can.
> Write the product name as lowercase 'xorlab'. Use the documented component names: xorlab Control Center (XCC), xorlab MTA, xorlab Sandbox (DANA), xorlab Natural Language Understanding (NLU). After the first mention, use the short forms XCC, MTA, Sandbox, and NLU. Do not use DANA as a standalone name for the Sandbox, but keep it where it is a literal string in configuration keys, container names, and hostnames.
> Do not invent configuration keys, rule parameters, list names, log properties, or API fields. If a value is not present in this documentation, say that it is not documented rather than guessing.

# Before You Begin

> Choose which events to log and which log format to use before configuring any logging channel.

## Choose log event

1. Visit the [Log Events](/latest/logging-events) page

2. Choose the event that should be logged. Common ones are [Audit events](/latest/logging-events#audit-trail-events) or [SMTP events](/latest/logging-events#message-tracing-events).

3. Take note of the `Event Name` and `Container` of the chosen event.

4. In the Expert Editor, navigate to the right directory based on `Container`:
   | Container | Directory                                                              |
   | :-------- | :--------------------------------------------------------------------- |
   | Core      | **activeguard/core/**                                                  |
   | Mta       | **activeguard/mta/audit/**                                             |
   | Backend   | **xcc/backend/**                                                       |
   | Auth      | **auth/auth/**                                                         |
   | Dana      | **/etc/xorlab/dana/default/** <br /> *- Modify configurations via ssh* |

5. Create the file `logback-audit.xml` if it does not exist and add:
   ```xml logback-audit.xml theme={null}
   <?xml version="1.0" encoding="UTF-8"?>
   <included>
   <!-- add <appender> elements on top -->
   <!-- add <logger> elements below -->
   </included>
   ```

6. Click **Publish**. The logging configuration becomes active within about one minute.

## Choose log format

Choose in which format the event should be logged. This will be required later on when configuring the logging. No action required now.

<CardGroup cols={2}>
  <Card title="JSON" icon="code" href="/latest/logging-formats#json">
    Default. Supported for all events.

    ```xml highlight={3} theme={null}
    <appender>
        <encoder>
            <pattern>%jsonMsg%n</pattern>
        </encoder>
    </appender>
    ```
  </Card>

  <Card title="JSON Extended" icon="code" href="/latest/logging-formats#json-extended">
    Same as *JSON*, but contains more data.

    ```xml highlight={3} theme={null}
    <appender>
        <encoder>
            <pattern>%coreJsonMsg%n</pattern>
        </encoder>
    </appender>
    ```

    <Note>
      Can only be used for `trace.*` events.
    </Note>
  </Card>

  <Card title="CEF" icon="scroll" href="/latest/logging-formats#common-event-format-cef">
    Common Event Format (CEF). Supported for all events.

    ```xml highlight={3} theme={null}
    <appender>
        <encoder>
            <pattern>%cef%n</pattern>
        </encoder>
    </appender>
    ```
  </Card>
</CardGroup>
