Skip to main content

Logs

Using GoZync's Logs

The logs in GoZync are completely customizable and can be a great help in finding your way through GoZync's scripts. Here are some tips for making the most out of them. See "Customizing Logs" below.

There is a Zync Logs tab in both GoZyncMobile and GoZyncHosted. The difference is that GoZyncHosted shows the most recent log for each synced device; GoZyncMobile only show that device's log.

The contents of the mobile and hosted logs will be the same if the sync was allowed to finish with the connection to the host still open. If the connection to the host breaks before the sync is complete you'll see a partial log in GoZyncHosted and the complete log will be in GoZyncMobile.

Errors are shown in orange. Learn more about common error codes here:  Error Codes.

Here is a short video on how to use the logs in conjunction with the (amazing) 2empower developer assistant to really get inside GoZync:

Log History

GoZync only saves the latest sync log for each device. Those logs are written by FileMaker scripts, though, so you could alter the script to save copies in a new related table of your own design. The finished log is processed in the script "Save Log To Disk" in GoZyncMobile and the hosted files are still open at that point, in case you wanted to set the log contents to a new record in a hosted table.

Customizing Logs

The log is completely customizable, and some of what you want is already there. Here is a log from a multi-table zync where we ran the script "Zync It - This File" (that runs the default sync action for each table). You'll see the tables passed it at the top of the log and then as each table begins you'll see it's name again in the log along with its default action like this: "Running default action for \<table occurrence name>: \<action>"

You can add whatever else you'd like to the log. Here's how.

In any script, set a variable $NoResult to the custom function "gz_Timer_Split" and pass into the function whatever you'd like to see in the log. For example, this...gz_Timer_Split( "Connecting to server..." )

...adds the phrase "Connecting to server..." to the log and gives it a split time. You can do this in the scripts of both GoZyncMobile and GoZyncHosted.

Not sure which scripts to insert steps into? The log can help there as well: run a sync and then find a phrase in the log you're interested in, like "Looking for records to delete". Then  search the scripts (video below) of GoZyncMobile / Hosted for that phrase and you'll find exactly where that happens in our scripts. (Turns out "Looking for records..." happens in the script "Delete Records Not In The IDs List (IDs)" in GoZyncMobile.)

Search scripts video:

If you run a sync with some breakpoints in that script you can use the data viewer to see what other variables you have access to at that point for possible inclusion in your new log message.