Course menu

Module 7: Operations and PracticeLesson 7.2 (2 of 4 in this module)31 of 33 in the FortiGate Administrator course

Logging and monitoring

Traffic, event and security logs, where to store them (disk, FortiAnalyzer, syslog, cloud), reading logs in the GUI and CLI, and alerts with automation.

Intermediate · 11 min read

What you will learn

After this lesson, you can name the FortiGate log types, send logs to a central collector, filter logs in the GUI and CLI, and set up an alert for an important event.

  • Log types
  • Log destinations
  • Reading logs
  • Automation alerts

FortiGate logging records what the FortiGate does: traffic logs for sessions passing through or to it, event logs for the system itself (admin logins, VPNs, HA, routing), and security logs for profile detections. Logs can be kept locally (memory or disk) and sent to FortiAnalyzer, FortiGate Cloud or syslog servers, where they are stored longer, searched and reported on.

In simple terms: The FortiGate keeps a diary of every connection, every change and every attack it stops, and can send copies of it somewhere safe.

A real-life situation

An auditor asks: "Who connected to the finance server last month, and who changed the firewall rules on the 3rd?" Another day a manager wants an email whenever a VPN tunnel to the branch goes down. Each answer depends on the FortiGate having logged the right things to a place where they still exist.

Log types

TypeSubtypesAnswers
TrafficForward (through), local (to/from the FortiGate), snifferWho talked to whom, by which policy, how much
EventSystem, user, VPN, router, HA, SD-WAN, endpoint…Who logged in, what changed, which tunnel dropped
SecurityAntiVirus, web filter, DNS filter, application control, IPS…What was detected and blocked

Traffic logging is set per policy (logtraffic: all sessions, security events only, or off). Event logging is set globally under Log & Report › Log Settings.

Where logs go

config log fortianalyzer setting set status enable set server "10.0.1.30" set upload-option realtime end config log syslogd setting set status enable set server "10.0.1.40" set mode udp set port 514 end

FortiAnalyzer receives logs in real time and gives search, reports and long retention; the FortiGate must be authorised on the FortiAnalyzer. A syslog server (or SIEM) can receive a copy at the same time. FortiGate Cloud is the hosted option for small sites.

Reading logs

Simplified illustration of the FortiOS 7.4 GUI · not a screenshot
FGT1Log & Report › Forward Traffic

Forward Traffic (filter: destination 10.0.2.10, last 7 days)

Date/TimeSourceUserDestinationServicePolicyResult
10-10 16:4110.0.1.23alice10.0.2.10HTTPS8Accept (2.1 MB)
10-10 14:0210.0.1.40carol10.0.2.10HTTPS4Deny: policy violation
10-09 09:15198.51.100.7710.0.2.10HTTPS6Accept (48 kB)
Filtering by destination answers the auditor's first question; the user column appears because policy 8 uses authentication. Configuration changes are under System Events, with the admin's name.

On the CLI, the same search:

execute log filter category traffic execute log filter field dstip 10.0.2.10 execute log display

Filters select the log category and fields; display prints the matching entries (from the device's own storage). execute log filter reset clears the filters.

Watching it live

  • Dashboards and FortiView: top sources, destinations, applications, threats and policies, with drill-down to the logs.
  • SNMP: CPU, memory, sessions and interface counters for your monitoring system; traps for events such as HA failover.
  • Automation stitches: a trigger, such as an IPsec tunnel going down, an HA failover or an admin login failure, linked to an action, such as an email, a webhook or a CLI script.
Example output · based on Fortinet documentation; exact format varies by model and FortiOS version
FGT1 # get system performance status
CPU states: 3% user 1% system 0% nice 96% idle 0% iowait 0% irq 0% softirq
CPU0 states: 3% user 1% system 0% nice 96% idle 0% iowait 0% irq 0% softirq
Memory: 2055456k total, 851288k used (41.4%), ...
Average network usage: 41250 / 39870 kbps in 1 minute, ...
Average sessions: 1834 sessions in 1 minute, ...
Uptime: 12 days,  4 hours,  31 minutes
A quick health check from the CLI. (Example output, trimmed.)

Why it works this way

A firewall makes thousands of decisions a minute; logs are the only record of them. Keeping logs off the device protects them from being lost on reboot or erased by an attacker who gets in, and a central collector lets you search across many FortiGates at once.

Common mistakes

  • Relying on memory logging on a small model, then finding nothing after a reboot.
  • Logging off on the implicit deny and no logged deny-all policy, so blocked traffic leaves no trace.
  • Wrong time or time zone, making logs impossible to correlate with other systems (set NTP).
  • Never testing alerts until the day they were needed.

Key takeaways

✅ Key takeaways
  • Logs are traffic, event and security; traffic logging is chosen per policy.
  • Send logs off the device to FortiAnalyzer, FortiGate Cloud or syslog.
  • Filter in Log & Report or with execute log filter and execute log display.
  • Use FortiView, SNMP and automation stitches to watch and alert.

Check yourself

Predict · scenario 1

Which log type shows who changed a firewall policy?

Predict · scenario 2

You need an email whenever the VPN to the branch goes down. What do you configure?

Predict · scenario 3

A small FortiGate without a disk has no logs from before last night's reboot. Why?

FAQ

Why can't I find yesterday's traffic logs?
Small models without a disk keep logs in memory only, and only a limited amount; they are lost on reboot. Send logs to FortiAnalyzer, FortiGate Cloud or syslog for anything you need to keep.
Does logging every session slow the FortiGate down?
It costs some resources, especially writing to a local disk. Sending logs to a remote collector is lighter. Log all sessions where you need the record, and security events only on very busy, low-risk policies.