> ## 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.

# Enable Logging to a File

> Write log events to a local file. Supported for on-premises deployments only.

<Warning>
  **Prerequisites**

  * Complete [Before You Begin](/latest/logging-before-begin)
</Warning>

Follow these steps:

1. Open the `logback-audit.xml` as created in [Before You Begin](/latest/logging-before-begin#choose-log-event).

2. Add the following `appender` and `logger`:

   ```xml logback-audit.xml theme={null}
   <?xml version="1.0" encoding="UTF-8"?>
   <included>
       <appender name="rollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
           <file>${log_dir}/mylogfile.log</file>
           <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
               <fileNamePattern>${log_dir}/mylogfile-%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
               <maxFileSize>10MB</maxFileSize>
               <maxHistory>30</maxHistory>
           </rollingPolicy>
           <encoder>
               <pattern>%d{yyyy-MM-dd HH:mm:ss} - %jsonMsg%n</pattern>
           </encoder>
       </appender>

       <!-- Change the name to the desired Event -->
       <logger name="audit">
           <appender-ref ref="rollingFileAppender"/>
       </logger>
   </included>
   ```

3. Optional: Adjust `file` and `rollingPolicy` for custom log files and retention policies.

4. Optional: Adjust `pattern` to the chosen format as described in [Before You Begin](/latest/logging-before-begin#choose-log-format).

5. Adjust the `logger name` to match the event that you want to log.

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