I simply cannot talk enough about the importance of logging. You may have read my plea here to make sure that when you install FileMaker Server, you enable all of the available logging options.
FileMaker Server gives us a few new options.
Separate Script Event Log
When you execute a script server-side, either through Perform Script On Server or through a server-side script schedule, FileMaker Server will add an entry to its Event.log for every script error that it encounters while running the script.
We have often seen that the sheer amount of logged script errors drowns out the other useful information that is in the Event.log. And since FileMaker Server only keeps the current log and the previous log (it turns over by default at 40MB of data), that can mean that you are left without valuable troubleshooting information besides uncaught errors in the scripts.
FileMaker Server 2023 changes its default behavior by introducing a new log: scriptEvent.log. All script errors go into that new log, leaving the old Event.log for all other information, errors, and warnings about FileMaker Server’s functioning.
If you’d rather have the old behavior back (we don’t recommend it), you can change the setting on the Admin Command Line:
fmsadmin set serverprefs ScriptLogToEventLog=true
Note that you will have to restart FileMaker Server for this change to take effect. There is no Admin API option for this, and there is no Admin Console toggle for it, either.
But there is a new toggle in the Admin console named Allow Script Error Log. You will learn more about that one in the next section. The log tells you when the error happened, the error number and information on the schedule or the PSoS script in what file, and what script step on what line threw the error.
We think this is a massive improvement with the double benefit of leaving the Event.log to capture crucial information on how FileMaker Server is doing and a dedicated log for FileMaker developers to peruse as a basis for making the scripts better.
Script-based Error Logging
Scripts that you run through the FMSE script engine (used by the Perform Script on Server script step and by server-side schedules) now support the Set Error Logging script step.
The two other server-side script engines (WPE, used by WebDirect, and DAPI, used by the Data API) do not support this script step yet.
The script step has been around in FileMaker Pro and Go since version 18. When you use it, FileMaker Pro/Go creates a log in the user’s Documents folder and adds an entry when a script step generates an error. On FileMaker Server, the log goes into the normal Logs folder with all its siblings:
The same restrictions apply to this script step on the server as they do on the client:
- The step enables error logging from that point forward until it is turned off
- The script that contains the script step needs to run as Full Access. Either because the user has those privileges or the script has been elevated to always run under Full Access
And there is one extra restriction; on FileMaker Server, you can control whether the script step will function or not.
The setting is on by default, meaning that your server will allow the logging initiated by the script step. If you want to prevent scripts from using the logging script step, then you can toggle the setting off.
You may wonder what this type of logging adds to the mix when we already know that FileMaker Server logs all script errors to either the Event.log or the new scriptEvent.log.
The extra benefit comes in the form of the ability to add custom debug information to the log entry:
Anything that is relevant to help you debug, such as the layout name the user was on, what record, some of the record’s data…
Next Steps in Your FileMaker Solution
If you have any questions about this topic or the broader topic of monitoring and troubleshooting FileMaker Server, reach out to our team.
Want to learn more about FileMaker 2023? Explore more content on the platform from our team as well as resources from Claris.
2 thoughts on “Extra Logging Options in FileMaker Server 2023”
Thank you for this write up Wim! Appreciate all the work you’ve done for the community.
My understanding is that previously the “Set Error Logging [On]” script step didn’t calculate what was in The “Custom Debug Info” calculation on error, but when the “Set Error Logging [On]” step was called, making not as useful for generating information when the error happens. Has this behavior changed with FileMaker 2023?
Just ran a quick test and it behaves properly locally and when run server-side. The extra info from the Custom Debug Info is there.