1 of 1 people found this helpful
I am trying to track down a problem with a script I am running from the server. In an attempt to try to determine where the problem is, I have created another script that writes a record to a log table. In this way, I thought I would be able to track down the problem within the script.
However, the script that writes the log file does not seem to work when it is trigered by a server script. If I run the same proces from the client, the script works fine.
In the bottom, left of the edit script window, make sure to select "server" in the show compatibility menu. This will show you what commands are compatible or not. The other place to look for info is in the Server Events log in the FMS console. It shows entries about when a server-side task starts, errors it encounters and so forth. Depending on whether you have Allow User Abort = OFF/ON in your script will determine if it stops on an error or not. Set it to OFF if you want it to continue processing.
You are on the correct path in my opinion about doing your own logging. I assume for this that you have just created a "log" table in your dB file. In your main script that you are trying to debug, just insert steps to write a record to the log table. You could also have the log table just contain one record with one text field and write data to that one field. Just apply the new text to the existing contents for each "entry".
Doug de Stwolinska
1 of 1 people found this helpful
You can also schedule a script sequence in FileMaker Server. I do this to run a batch file (windows) or shell script (Mac) to append a log file after scripts run. Works like a charm!
Take a look at this:
Basically you write to the FileMaker log by putting the relogin step into your script wherever you want something logged. You put whatever message you want to appear in the log into the account name & FMS will register the "error" in it's log and give you the account name that failed to log in.
I used this just yesterday to see which parts of a server script took a long time.
Thanks Doug! Those were great ideas - I forgot there was a "Server" option under the show compatibility pulldown.
Unfortunately, I was not using any invalid scroipt steps and the Allow User Abort option was set to "Off". I was trying to write to a log table - however, it was in another DB (I am trying to seperate the data from the interface). Do you think that could be the problem? I'm still baffled on why the script writres to the log table when it is run from the client but not from the server.
Hi ODI (I use you guys for one of my DB hosting).
Anyway, thanks for the response. When you say "script sequence", do you mean a script schedule?
Also, when you say "append a log file", can you tell me a little more about that?
Eric may have gone out-of-bounds,
Is the log table in a file on the same FMS? FMS is not a client and cannot connect to a file located on a different FMS.
Is the file containing the log table in the same folder on the FM Server as the file you're running the server side script in?
You might have to add an additional file reference if that is the case using the relative path format, e.g.:
Thanks for your response. I think you might have pointed out the problem. My DB's are in different folders. I think I will just combine them into one folder, thus avoiding any potentil path issues.
If the DB's are in the same folder, and I am accessing a table in a diffferent DB, do I have to do anything special?
If all the db's are in the same folder then everything should "just work" as far as the server side script is concerned.
Make sure that you don't inadvertantly break any existing file references from other files to the file you're planning to move.