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: 9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4    Statistic  

Trace

Starts logging all plugin calls to a text file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Plugin 2.4 Yes Yes Yes Yes Yes
MBS( "Trace" { ; path; Append } )   More

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.ErrorsOnly.

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:

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 10th August 2020


TouchBar.Visible   -   Trace.AreErrorNotificationsEnabled

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins