June 16, 2011

The past

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.

The future

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:

  • services.sync.log.appender.file.logOnError (default: true)
  • services.sync.log.appender.file.logOnSuccess (default: false)

If you had logging enabled before, services.sync.log.appender.file.logOnSuccess will be turned on for you automatically.


3 Responses to “about:sync-log”

  1. Good idea?
    Does it clean out after some time or will profiles grow without bounds?

  2. Will Fiveash Says:

    Phil, if you have a chance please take a look at this FF5 bug I opened http://bit.ly/pKm5vz (it involves sync). I’ve stopped using sync as a result and it’s driving me nuts.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: