Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Trace
Starts logging all plugin calls to a text file.
Component |
Version |
macOS |
Windows |
Linux |
Server |
iOS SDK |
Trace
|
2.4 |
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
✅ Yes
|
MBS( "Trace" { ; path; Append } )
More
MBS(
"Trace"; /* Starts logging all plugin calls to a text file. */
$path; /* Optional; The native file path to the log file.e.g. "/Users/name/Desktop/debug.txt" */
$Append) /* Optional; Whether to append or create new file.
Pass 1 to append or 0 (default) for new file.e.g. 1 */
Less
Parameters
Parameter |
Description |
Example |
Flags |
path |
The native file path to the log file. |
"/Users/name/Desktop/debug.txt" |
Optional |
Append |
Whether to append or create new file.
Pass 1 to append or 0 (default) for new file. |
1 |
Optional |
Result
Returns "OK" on success.
Description
Starts logging all plugin calls to a text file.
If you pass a path, debug messages are written to the file. Else the plugin writes to debug console. See Console.app on Mac or DebugView on Windows.
See also Trace.Off and Trace.SetErrorsOnly.
On Linux, if no path is provided, the log output will go to stderr, which is usually redirected by our plugin to /FileMakerData/Logs/ or /opt/FileMaker/FileMaker Server/Logs/ folder. The log files are WebPluginsStdErr and WebPluginsStdOut for Web Direct and ServerScriptingPluginsStdErr and ServerScriptingPluginsStdOut for normal scripting.
On Windows with a FileMaker Server, you can see debug messages in DebugView if you run DebugView application as admin and enable global Win32 listening.
For FileMaker Server on macOS you can see messages in /Library/FileMaker Server/Logs/stderr file.
On Windows the log file is UTF-16 with BOM and CRLF as line endings. On macOS, Linux and iOS, you get an UTF-8 file with BOM and LF line endings.
See Trace.GetErrorsOnly, Trace.GetWithTimes, Trace.SetErrorsOnly and Trace.SetWithTimes to set options.
This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.
Examples
Log plugin calls to console:
MBS( "Trace" )
Log plugin calls to desktop on Windows:
MBS( "Trace"; "C:\Documents\Christian\Desktop\plugin.txt")
Log plugin calls to temp folder on Mac or Linux:
MBS( "Trace"; "/tmp/MBS Plugin Log.txt")
Log to log file on desktop:
Set Variable [$TracePath; Value:MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "trace.txt" )]
Set Variable [$r; Value:MBS("Trace"; $TracePath)]
See also
Blog Entries
FileMaker Magazin
Created 18th August 2014, last changed 28th March 2021
TouchBar.Visible
-
Trace.AreErrorNotificationsEnabled
Feedback: Report problem or ask question.