• Contact
  • About Me
  • Privacy Policy
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Network Tutorials FortiGate

Fortinet FortiGate Logging: Log Management and Best Practices

neo by neo
May 27, 2025
in FortiGate
0
Fortinet FortiGate Logging: Log Management and Best Practices

Fortinet FortiGate Logging: Log Management and Best Practices

0
SHARES
152
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

FortiGate Log Management

FortiGate Logging and general logging is a crucial aspect of network security and monitoring, allowing administrators to track activities, diagnose issues, and ensure compliance. Fortinet FortiGate provides extensive logging capabilities, capturing detailed information about network traffic, security threats, and system events. This guide explores FortiGate logging, covering log types, severity levels, local and remote logging, best practices, and log management techniques. By implementing effective logging strategies, organizations can enhance network visibility, improve threat detection, and optimize performance.

Log Basics

As traffic moves through the FortiGate firewall and into the network, FortiGate actively scans it and takes action based on the firewall policies. During this process, the firewall records activity and saves relevant information in a log message, which is then stored in a log file.

Logs play a crucial role in monitoring network traffic, identifying issues, and improving security. They also help fine-tune network defenses. To ensure an effective logging system, accurate date and time settings are essential. Therefore, using a Network Time Protocol (NTP) server is highly recommended.

ADVERTISEMENT

Log Workflow

FortiGate logs provide crucial insights into network activity, security events, and system performance. The logging process follows a defined workflow:

  1. Event Occurrence: An event is triggered based on user activity, security policies, or system changes.
  2. Log Generation: The FortiGate system categorizes and formats the event into a log entry.
  3. Log Storage and Forwarding: Logs are either stored locally (flash memory or hard drive) or sent to remote log servers such as FortiAnalyzer, FortiManager, or Syslog.
  4. Log Analysis and Reporting: Administrators can view, search, and analyze logs to detect anomalies, troubleshoot issues, and generate reports.

Log Types and Subtypes

FortiGate logs are categorized into different types and subtypes:

  • Traffic Logs: Capture network traffic details, including source/destination IP, protocol, and port.
  • Event Logs: Record system activities such as admin logins, configuration changes, and firewall policy updates.
  • Security Logs: Contain threat intelligence from features like IPS, antivirus, web filtering, and application control.
TrafficEventSecurity
ForwardEndpoint ControlApplication Control
LocalHigh AvailabilityAntivirus
SnifferSystemData Leak Prevention (DLP)
UserAnti-Spam
RouterWeb Filter
VPN (Virtual Private Network)Intrusion Prevention System (IPS)
WAD (FortiOS Webproxy Process)Anomaly (DoS-Policy)
WirelessWeb Application Firewall (WAF)

Log Severity Levels (0-7)

FortiGate assigns severity levels to logs based on their impact:

  • 0 – Emergency: System is unusable.
  • 1 – Alert: Immediate action required.
  • 2 – Critical: Critical conditions detected.
  • 3 – Error: Error conditions encountered.
  • 4 – Warning: Potential issues or security concerns.
  • 5 – Notification: Normal but significant events.
  • 6 – Information: General informational messages.
  • 7 – Debug: Detailed debug information for troubleshooting.

0 = high importance / 6 = low importance

Log Message Structure

Each FortiGate log message comprises two primary components:

  • Log Header: Includes metadata such as timestamp, log ID, severity, and device details.
  • Log Body: Contains detailed event information, including source, destination, and specific actions taken.

Effect of Logging on Performance

More logs = more CPU, memory, and disk space!

Extensive logging can impact FortiGate performance by consuming CPU, memory, and storage.

  • Logging in Security Fabric: When you integrate Fortinet’s Security Fabric, the system centrally collects and processes logs, which helps reduce the load on individual devices.
  • Optimizing Logging: To mitigate performance issues, administrators should enable only necessary logs, configure log rotation, and use external log storage solutions.

From the FortiGate CLI, you can enable performance statistics logging for remote logging devices such as FOrtiAnalyzer and Syslogto occur every 1-15 minuts. This is not possible for local disk logging or FortiCloud.

config system global
set sys-perf-log-interval <number from 0-15>
end

Best Practices for Log Management

  • Create a log management plan:
    • What activities do you want and need logged?
    • Backup solution in the event a faulure
    • Archiving of logs (FortiAnalyzer can help)
    • Utilize remote logging solutions to offload storage from FortiGate.
    • Regularly audit logs for security and compliance.

General logging best practices:

  • Enable log rotation to prevent storage overflow
  • Use structured log retention policies.

Local Logging

To store logs locally on FortiGate you must enable disk logging. With disk logging enabled , the report daemon collects statistics used for historical FortiView from disk. By default, logs older than seven days are automatically deleted. from the disk. You can change it on this way:

FortiGate Local Memory Log
FortiGate Local Memory Log
fgt-remote1 # config log memory global-setting

fgt-remote1 (global-setting) # get
max-size            : 65536
full-first-warning-threshold: 75
full-second-warning-threshold: 90
full-final-warning-threshold: 95

Flash Memory

FortiGate devices with onboard flash memory can store logs locally (not recommended), but the storage capacity is limited.

  • Constant rewrites can reduce the lifteime and efficiency of the memory
  • Logging disabled by default
  • Not recommended for logging, should use external logging device instead

Hard Drive

Some FortiGate models include a hard drive for extended log storage. Hard drives allow for longer retention periods and are useful for local log analysis before offloading logs to a remote server.

ADVERTISEMENT
  • FortiGate devices that have a hard drive store logs in a SQL database
  • Reports retrieve data from the SQL database.

Remote Logging

FortiAnalyzer

FortiAnalyzer provides centralized log collection, storage, and analysis with advanced reporting and event correlation.

FortiManager

FortiManager integrates logging with network management, allowing administrators to monitor configurations, policies, and logs in one platform.

ADVERTISEMENT

Syslog

Syslog servers collect logs from multiple devices for long-term storage, analysis, and integration with third-party SIEM solutions.

FortiCloud

FortiCloud offers cloud-based log storage and analysis, reducing on-premises storage needs while providing accessibility from anywhere.

Log Settings

Administrators can configure logging settings under Log & Report > Log Settings in the FortiGate GUI. Key configurations include:

  • Enabling/disabling logs for specific events
  • Setting log levels for different services
  • Choosing log storage locations (local vs. remote)
  • Configuring log retention and rotation policies
FortiGate Log Settings
FortiGate Log Settings

Viewing, Searching, and Monitoring Logs

Logs can be accessed via:

  • GUI: Under Log & Report, logs are categorized for easy viewing.
  • CLI: Use execute log display command.
  • FortiAnalyzer/FortiManager: Provides advanced search and filtering capabilities.
fgt-remote1 # execute log display
0 logs found.
0 logs returned.

Generate test log message:

diagnose log test
generating a system event message with level - warning
generating an infected virus message with level - warning
generating a blocked virus message with level - warning
generating a URL block message with level - warning
generating a DLP message with level - warning
generating an IPS log message
generating an anomaly log message
generating an application control IM message with level - information
generating an IPv6 application control IM message with level - information
generating deep application control logs with level - information
generating an antispam message with level - notification
generating an allowed traffic message with level - notice
generating a multicast traffic message with level - notice
generating a ipv6 traffic message with level - notice
generating a wanopt traffic log message with level - notification
generating a HA event message with level - warning
generating a VOIP event message with level - information
generating authentication event messages
generating a Forticlient message with level - information
generating a URL block message with level - warning
generating a DNS message with level - warning
generating an ssh-command pass log with level - notification
generating an ssh-channel block with level - warning

Check the logs under Log & Report -> Web Filter

FortiGate Web Filter Example
FortiGate Web Filter Example

Enable Logging in Firewall Policy

If you configure your FortiGate to inspect traffix you should enable logging for that security feature to track and debug your traffic flow.

You can enable logging in firewall policies on this way:

  • Enable security profile or all of them
  • Enable Log Allowed Traffic: Security Events or All Sessions
    • In my case I enabled just “Security Events”
FortiGate Policy Logging
FortiGate Policy Logging

Protecting Log Data

Ensuring log integrity is critical for security and compliance:

  • Enable encryption for remote log transmission.
  • Use access controls to restrict log viewing.
  • Implement redundancy by storing logs in multiple locations.
  • Regularly back up logs to prevent data loss.

By following best practices and leveraging FortiGate’s robust logging capabilities, administrators can gain valuable insights into their network, improve security, and ensure regulatory compliance.

You can check my aritcle related to the Fortient FortiGate: Network Monitoring with Custom Dashboards to discover more about logging.

About The Author

neo

See author's posts

Tags: fortigate
ADVERTISEMENT
Previous Post

FortiGate Antivirus: Configuration, Best Practices, and Troubleshooting

Next Post

Configure FortiGate as a DHCP Server via GUI and CLI

neo

neo

Next Post
Configure FortiGate as a DHCP Server via GUI and CLI

Configure FortiGate as a DHCP Server via GUI and CLI

Follow Us

  • Trending
  • Comments
  • Latest
MikroTik: Export Configuration in Text File

MikroTik: Export Configuration in Text File

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Fortinet FortiGate: Static Route Configuration via GUI and CLI

Immich: Installation on Ubuntu 22.04

Immich: Installation on Ubuntu 22.04

Fortinet FortiGate Upgrade Path Tool

Fortinet FortiGate Upgrade Path Tool

NextCloud: Port Forwarding - Essential Ports for Smooth Functionality

NextCloud: Port Forwarding – Essential Ports for Smooth Functionality and Remote Access

Organizing and Managing Photos with Immich: Features I Use

Organizing and Managing Photos with Immich: Features I Use

Install Ubuntu 22.04 on Oracle VM Virtual Box

Install Ubuntu 22.04 on Oracle VM Virtual Box

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Linux Directories: cd (Change Directory), pwd (Print Working Directory), mkdir (Make Directory)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nginx Proxy Manager on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

Install Docker on Raspberry Pi 4 with Ubuntu 22.04

MikroTik: Check Your Wireless Password

MikroTik: Check Your Wireless Password

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Browse by Category

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos

Recent News

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install WordPress on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

Install Nextcloud on Raspberry Pi 4 with Docker (Ubuntu 22.04)

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.