Set Error Logging

Controls whether errors are logged while the current file's scripts are running.

Options 

  • On starts logging script errors. Errors continue to be logged for all scripts in the current file until the file is closed or this script step is run with the Off option.
  • Off stops logging script errors.
  • Custom debug info is an expression evaluated when a script error is logged. Use this option to provide additional information that will help you debug a problem.

Compatibility 

Product Supported
FileMaker Pro Yes
FileMaker Go Yes
FileMaker WebDirect No
FileMaker Server Yes
FileMaker Cloud No
FileMaker Data API No
Custom Web Publishing No

Originated in version 

18.0

Description 

After this script step is performed, the ScriptErrors.log file is created in the user's Documents folder when the first script error is caused by any script in the current file. An entry is added to the log file whenever a script step returns a nonzero error code. If the log file already exists, entries are appended to the file.

Each line in the ScriptErrors.log file presents information in the following order separated by Tab characters:

Log entry information

Notes

Timestamp

The client's date and time when the error occurred.

Database session number

ID of the session the script is running in.

Filename

The name of the file the script is in.

Account name

The account that ran the script.

Script name [script index]

The index is the script's position (starting with 1) in the scripts pane in the Script Workspace.

Step name [line number]

 

Error code

See FileMaker error codes.

Custom debug info

 

Notes 

Example 1 

Turns on script error logging and adds the current values of a variable and a field to help debug a problem.

Copy
Set Error Logging [ On ; Custom debug info: "Index: " & $Counter & ", PrimaryKey: " & Table::PrimaryKey ]

When the first error occurs, the ScriptErrors.log file contains:

Copy
2024-01-22 09:43:04.552 -0800   @1   Inventory.fmp12   Admin   Process records [42]   Read from Data File [7]   100   Index: 7, PrimaryKey: 20E190F3-67A8-4DCF-94CF-A5EA72971FFC