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.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
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/trace.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/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
Release notes
- Version 13.1
- Fixed a crash in trace function.
Blog Entries
This function is free to use.
Created 18th August 2014, last changed 3th March 2023
TouchBar.Visible
-
Trace.AreErrorNotificationsEnabled