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:
12.0
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
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 |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
path | The native file path to the log file. | "/Users/name/Desktop/trace.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 StdErrWebPlugins and StdOutWebPlugins for Web Direct and StdErrServerScriptingPlugins and StdOutServerScriptingPlugins 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.
Added tracing of SQL commands for our SQL functions for v13.1. The SQL may be truncated around 4000 characters to limit how much text we log.
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"; MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "trace.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)]
Setup logging on server with multiple log files and times:
Set Variable [ $r; Value: MBS( "Trace.SetWithTimes"; 1) ]
Set Variable [ $r; Value: MBS( "Trace.SetServerLogPath"; "/Library/FileMaker Server/Logs/") ]
Set Variable [ $r; Value: MBS( "Trace") ]
See also
- Folders.UserDesktop
- IsRegistered
- Path.FileMakerPathToNativePath
- Socket.Read
- Socket.Write
- Trace.GetWithTimes
- Trace.Off
- Trace.Path
- Trace.SetErrorsOnly
- Trace.SetWithTimes
Release notes
- Version 13.1
- Fixed a crash in trace function.
Blog Entries
- MBS @ FMTraining.TV - What’s New in the FileMaker MonkeyBread Plug-in - 13.2 Release
- Install a FileMaker 2023 Server in Linux in Parallels Desktop
- Using JavaScript with WebKit on FileMaker Server on Linux
- MBS FileMaker Plugin, version 13.1pr6
- Additional iOS Script Triggers
- Install MBS Plugin on a FileMaker Server
- Trigger scripts via plugin and fmplugin extended privilege
- FileMaker Server with Data API Plugins
- MBS Plugin Quiz
- Watching for Errors with MBS Plugin
FileMaker Magazin
This function does not need a paid license.
Created 18th August 2014, last changed 3th March 2023
