Skip to main content
zendodg
Staff
Staff
January 28, 2026

Troubleshooting Tip: Debug output on txt file for FortiAP

Description This article describes how to run a debug on FortiAP and send output to a text file.
Scope FortiAP.
Solution

There is an option on FortiAP where a debug output can be sent to a text file in memory, and this file can be sent to a tftp file.

 

This is an example, running cwctl debug on FortiAP and sending outputs to a file with the 'fon' FortiAP command:

 

cw_diag debug cwctl 4

FortiAP-U433F# cw_diag debug cwctl 4

Module Name: cwctl Debug Level 4

FortiAP-U433F# don
cwWtpd debug level is 32767 (0x7fff)
FortiAP-U433F# fon
Set log2file flog file (/tmp/var_log_wtpd) size to 16 MB
FortiAP-U433F#

 

The fon command will send us the file route where outputs are going to be saved. With the 'tftp' command, that file can be downloaded:

 

FortiAP-U433F# tftp 192.168.254.51
BusyBox v1.22.1 (2025-01-15 19:52:13 PST) multi-call binary.

Usage: tftp [OPTIONS] HOST [PORT]

Transfer a file from/to tftp server

-l FILE Local FILE
-r FILE Remote FILE
-g Get file
-p Put file
-b SIZE Transfer blocks of SIZE octets

FortiAP-U433F# tftp 192.168.254.51 -l /tmp/var_log_wtpd -r cwctl -p
tftp: server error: (2) Access violation

FortiAP-U433F# tftp 192.168.254.50 -l /tmp/var_log_wtpd -r cwctl -p
cwctl 100% |*************************************************************| 351k 0:00:00 ETA
FortiAP-U433F#

 

To turn debug off:

 

FortiAP-U433F# doff
cwWtpd debug level is 0 (0x0)
FortiAP-U433F# foff
Set log2file flog file (/tmp/var_log_wtpd) size to 0 MB
FortiAP-U433F# cw_diag debug cwctl 0

Module Name: cwctl Debug Level 0

FortiAP-U433F#

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT