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

# FortiGate Syslog UDP Setup

> Quick guide to enable FortiGate log forwarding via UDP for WAN and LAN policies.

This guide covers how to forward FortiGate traffic logs (WAN to LAN and vice versa) to a specific IP address and UDP port using Syslog, via both the **GUI** and **CLI**.

## Step 1: Configure Syslog Destination

You can configure the Syslog server target either through the Web GUI or using the CLI (recommended for custom UDP ports).

> [tab] GUI (Web Console)
>
> 1. Go to **Log & Report** > **Log Settings**.
>
> 2. Toggle on **Send Logs to Syslog**.
>
> 3. Enter the **IP Address/Name** of your Syslog server.
>
> 4. Set **Mode** to **UDP** (or leave default if standard port 514 is used).
>
> 5. Click **Apply** at the bottom of the page.
>
> > [!NOTE]
> >
> > The FortiGate GUI configures the default Syslog port (`UDP 514`). If you need to use a custom port, use the CLI tab instead.

> [tab] CLI (Custom Port)
>
> Run the following commands in the FortiGate CLI console:
>
> ```text theme={null}
> config log syslogd setting
>     set status enable
>     set server "192.168.1.100"
>     set mode udp
>     set port 514
>     set facility local7
> end
> ```
>
> > [!WARNING]
> >
> > Replace `192.168.1.100` with your Syslog server IP and `514` with your target UDP port.

***

## Step 2: Enable Logging on Firewall Policies

Traffic logs are only generated and sent if logging is explicitly enabled on the relevant firewall policies.

**1. Open Firewall Policies**

Navigate to **Policy & Objects** > **Firewall Policy**.

**2. Configure LAN -> WAN Policy**

1. Select the outbound rule (**LAN to WAN**) and click **Edit**.
2. Scroll down to the **Logging Options** section.
3. Enable **Log Allowed Traffic**.
4. Select **All Sessions** to capture all connections.
5. Click **OK**.

**3. Configure WAN -> LAN Policy**

1. Select the inbound rule (**WAN to LAN**, e.g., VIPs / Port Forwarding) and click **Edit**.
2. Enable **Log Allowed Traffic** > **All Sessions**.
3. Click **OK**.

***

## Step 3: Verify Traffic Output

To verify that Syslog UDP packets are actively being sent from the FortiGate, run a packet trace via CLI:

```text theme={null}
diagnose sniffer packet any 'host 192.168.1.100 and port 514' 4 0 l
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.