Reference > Script steps reference > Control script steps > Set Error Logging
 

Set Error Logging

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

See also 

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 Advanced 

Yes 

FileMaker Go 

Yes 

FileMaker WebDirect 

No 

FileMaker Server 

No 

FileMaker Cloud products 

No 

FileMaker Data API 

No 

Custom Web Publishing 

No 

Runtime solution 

No 

Originated in 

FileMaker Pro 18.0 Advanced

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

 

Important  The format of the script error log is provided as a preview to gather customer feedback; it may change significantly in future product versions and is not intended for use in production systems.

Notes 

To perform this script step, the user or the script must have full access privileges. See Creating and editing scripts.

Example 1 

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

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

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

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

Related topics 

Script steps reference (alphabetical list)

Script steps reference (category list)