June 16, 2011
For a long time Firefox Sync has had the ability to write a continuous log of what it’s doing to disk which is pretty easily accessible via about:sync-log. In the Firefox 4 beta cycle, we disabled the log by default because the disk activity of writing the log can hurt your browser’s performance, particularly on mobile (it also didn’t help that the writes to the log blocked the UI thread.)
Only problem is, having the log disabled by default means that whenever Sync fails somehow, the user won’t have a log of what happened. Right now they have to turn on logging in about:config, restart the browser, and then sync again. That means we really only have a chance of catching reproducible problems, not the intermittent ones.
Last week I spent a few days fixing the logging situation and with today’s nightly (and eventually Firefox 7) things have changed. Sync now keeps the log in memory and usually discards it after a successful sync. If an error occurs, however, the log will be written to a file (but not on the UI thread!) Consequently, about:sync-log has been changed to show you the directory where the individual log files are dumped. The most recent log files will be at the bottom of that listing. (Eventually we might make this a bit prettier, e.g. by taking some inspiration from about:crashes.)
Like before, it’s still possible to tweak logging behaviour in about:config, except now you get two preferences to define what should happen on a failed and successful sync, respectively:
If you had logging enabled before, s
ervices.sync.log.appender.file.logOnSuccess will be turned on for you automatically.