Backed out changeset 2f67ed3d7d6c (bug 451283) failures in mochitest and marionette
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Sat, 12 Oct 2013 10:51:43 +0200
changeset 164394 c34fa3ae8eb47f7d7c9b9ba969e5c0340244cdc3
parent 164393 c3dc4019b6f7776dc1e69ccd591b37e11f89d533
child 164395 1a5a56c79e3c634150dadc8d3f68c60c1c1e7387
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs451283
milestone27.0a1
backs out2f67ed3d7d6c8322c29a8c692736008defaf560f
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 2f67ed3d7d6c (bug 451283) failures in mochitest and marionette
browser/base/content/browser-data-submission-info-bar.js
browser/base/content/test/general/browser_datareporting_notification.js
services/common/Makefile.in
services/common/bagheeraclient.js
services/common/log4moz.js
services/common/modules-testing/bagheeraserver.js
services/common/modules-testing/logging.js
services/common/modules-testing/storageserver.js
services/common/rest.js
services/common/storageservice.js
services/common/tests/unit/head_helpers.js
services/common/tests/unit/test_load_modules.js
services/common/tests/unit/test_log4moz.js
services/common/tests/unit/test_restrequest.js
services/common/tests/unit/test_storage_server.js
services/common/tests/unit/xpcshell.ini
services/common/tokenserverclient.js
services/common/utils.js
services/datareporting/DataReportingService.js
services/datareporting/modules-testing/mocks.jsm
services/datareporting/policy.jsm
services/datareporting/sessions.jsm
services/healthreport/healthreporter.jsm
services/healthreport/profile.jsm
services/metrics/dataprovider.jsm
services/metrics/providermanager.jsm
services/metrics/storage.jsm
services/sync/modules-testing/fakeservices.js
services/sync/modules/addonsreconciler.js
services/sync/modules/addonutils.js
services/sync/modules/engines.js
services/sync/modules/engines/forms.js
services/sync/modules/engines/history.js
services/sync/modules/identity.js
services/sync/modules/jpakeclient.js
services/sync/modules/keys.js
services/sync/modules/notifications.js
services/sync/modules/policies.js
services/sync/modules/record.js
services/sync/modules/resource.js
services/sync/modules/rest.js
services/sync/modules/service.js
services/sync/modules/stages/cluster.js
services/sync/modules/stages/enginesync.js
services/sync/modules/status.js
services/sync/modules/userapi.js
services/sync/modules/util.js
services/sync/tests/unit/head_http_server.js
services/sync/tests/unit/test_addons_engine.js
services/sync/tests/unit/test_addons_reconciler.js
services/sync/tests/unit/test_addons_store.js
services/sync/tests/unit/test_addons_tracker.js
services/sync/tests/unit/test_bookmark_engine.js
services/sync/tests/unit/test_bookmark_legacy_microsummaries_support.js
services/sync/tests/unit/test_bookmark_livemarks.js
services/sync/tests/unit/test_bookmark_places_query_rewriting.js
services/sync/tests/unit/test_bookmark_record.js
services/sync/tests/unit/test_bookmark_smart_bookmarks.js
services/sync/tests/unit/test_bookmark_tracker.js
services/sync/tests/unit/test_clients_engine.js
services/sync/tests/unit/test_corrupt_keys.js
services/sync/tests/unit/test_errorhandler.js
services/sync/tests/unit/test_errorhandler_filelog.js
services/sync/tests/unit/test_forms_tracker.js
services/sync/tests/unit/test_history_tracker.js
services/sync/tests/unit/test_httpd_sync_server.js
services/sync/tests/unit/test_identity_manager.js
services/sync/tests/unit/test_interval_triggers.js
services/sync/tests/unit/test_jpakeclient.js
services/sync/tests/unit/test_keys.js
services/sync/tests/unit/test_node_reassignment.js
services/sync/tests/unit/test_password_store.js
services/sync/tests/unit/test_records_crypto.js
services/sync/tests/unit/test_resource.js
services/sync/tests/unit/test_resource_async.js
services/sync/tests/unit/test_resource_ua.js
services/sync/tests/unit/test_score_triggers.js
services/sync/tests/unit/test_sendcredentials_controller.js
services/sync/tests/unit/test_service_changePassword.js
services/sync/tests/unit/test_service_detect_upgrade.js
services/sync/tests/unit/test_service_getStorageInfo.js
services/sync/tests/unit/test_service_login.js
services/sync/tests/unit/test_service_sync_401.js
services/sync/tests/unit/test_service_sync_locked.js
services/sync/tests/unit/test_service_sync_remoteSetup.js
services/sync/tests/unit/test_service_sync_updateEnabledEngines.js
services/sync/tests/unit/test_service_verifyLogin.js
services/sync/tests/unit/test_syncscheduler.js
services/sync/tests/unit/test_syncstoragerequest.js
testing/marionette/components/marionettecomponent.js
testing/marionette/marionette-frame-manager.js
testing/marionette/marionette-listener.js
testing/marionette/marionette-server.js
toolkit/modules/Http.jsm
toolkit/modules/Log.jsm
toolkit/modules/Sqlite.jsm
toolkit/modules/moz.build
toolkit/modules/tests/xpcshell/test_Log.js
toolkit/modules/tests/xpcshell/xpcshell.ini
--- a/browser/base/content/browser-data-submission-info-bar.js
+++ b/browser/base/content/browser-data-submission-info-bar.js
@@ -14,19 +14,19 @@ let gDataNotificationInfoBar = {
   _DATA_REPORTING_NOTIFICATION: "data-reporting",
 
   get _notificationBox() {
     delete this._notificationBox;
     return this._notificationBox = document.getElementById("global-notificationbox");
   },
 
   get _log() {
-    let Log = Cu.import("resource://gre/modules/Log.jsm", {}).Log;
+    let log4moz = Cu.import("resource://services-common/log4moz.js", {}).Log4Moz;
     delete this._log;
-    return this._log = Log.repository.getLogger("Services.DataReporting.InfoBar");
+    return this._log = log4moz.repository.getLogger("Services.DataReporting.InfoBar");
   },
 
   init: function() {
     window.addEventListener("unload", function onUnload() {
       window.removeEventListener("unload", onUnload, false);
 
       for (let o of this._OBSERVERS) {
         Services.obs.removeObserver(this, o);
--- a/browser/base/content/test/general/browser_datareporting_notification.js
+++ b/browser/base/content/test/general/browser_datareporting_notification.js
@@ -53,20 +53,20 @@ function waitForNotificationClose(notifi
 }
 
 let dumpAppender, rootLogger;
 
 function test() {
   waitForExplicitFinish();
 
   let ns = {};
-  Components.utils.import("resource://gre/modules/Log.jsm", ns);
-  rootLogger = ns.Log.repository.rootLogger;
-  dumpAppender = new ns.Log.DumpAppender();
-  dumpAppender.level = ns.Log.Level.All;
+  Components.utils.import("resource://services-common/log4moz.js", ns);
+  rootLogger = ns.Log4Moz.repository.rootLogger;
+  dumpAppender = new ns.Log4Moz.DumpAppender();
+  dumpAppender.level = ns.Log4Moz.Level.All;
   rootLogger.addAppender(dumpAppender);
 
   let notification = document.getElementById("global-notificationbox");
   let policy;
 
   notification.addEventListener("AlertActive", function active() {
     notification.removeEventListener("AlertActive", active, true);
 
--- a/services/common/Makefile.in
+++ b/services/common/Makefile.in
@@ -1,13 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 modules := \
+  log4moz.js \
   storageservice.js \
   stringbundle.js \
   tokenserverclient.js \
   utils.js \
   $(NULL)
 
 pp_modules := \
   async.js \
--- a/services/common/bagheeraclient.js
+++ b/services/common/bagheeraclient.js
@@ -19,17 +19,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 #endif
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-common/utils.js");
 
 
 /**
  * Represents the result of a Bagheera request.
  */
 this.BagheeraClientRequestResult = function BagheeraClientRequestResult() {
@@ -42,18 +42,18 @@ Object.freeze(BagheeraClientRequestResul
 
 
 /**
  * Wrapper around RESTRequest so logging is sane.
  */
 function BagheeraRequest(uri) {
   RESTRequest.call(this, uri);
 
-  this._log = Log.repository.getLogger("Services.BagheeraClient");
-  this._log.level = Log.Level.Debug;
+  this._log = Log4Moz.repository.getLogger("Services.BagheeraClient");
+  this._log.level = Log4Moz.Level.Debug;
 }
 
 BagheeraRequest.prototype = Object.freeze({
   __proto__: RESTRequest.prototype,
 });
 
 
 /**
@@ -64,18 +64,18 @@ BagheeraRequest.prototype = Object.freez
  * @param baseURI
  *        (string) The base URI of the Bagheera HTTP endpoint.
  */
 this.BagheeraClient = function BagheeraClient(baseURI) {
   if (!baseURI) {
     throw new Error("baseURI argument must be defined.");
   }
 
-  this._log = Log.repository.getLogger("Services.BagheeraClient");
-  this._log.level = Log.Level.Debug;
+  this._log = Log4Moz.repository.getLogger("Services.BagheeraClient");
+  this._log.level = Log4Moz.Level.Debug;
 
   this.baseURI = baseURI;
 
   if (!baseURI.endsWith("/")) {
     this.baseURI += "/";
   }
 };
 
rename from toolkit/modules/Log.jsm
rename to services/common/log4moz.js
--- a/toolkit/modules/Log.jsm
+++ b/services/common/log4moz.js
@@ -1,32 +1,31 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
 "use strict";
 
-this.EXPORTED_SYMBOLS = ["Log"];
+this.EXPORTED_SYMBOLS = ['Log4Moz'];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
 const ONE_BYTE = 1;
 const ONE_KILOBYTE = 1024 * ONE_BYTE;
 const ONE_MEGABYTE = 1024 * ONE_KILOBYTE;
 
 const STREAM_SEGMENT_SIZE = 4096;
 const PR_UINT32_MAX = 0xffffffff;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS",
                                   "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
                                   "resource://gre/modules/Task.jsm");
 
-this.Log = {
+this.Log4Moz = {
   Level: {
     Fatal:  70,
     Error:  60,
     Warn:   50,
     Info:   40,
     Config: 30,
     Debug:  20,
     Trace:  10,
@@ -49,23 +48,23 @@ this.Log = {
       "CONFIG": 30,
       "DEBUG": 20,
       "TRACE": 10,
       "ALL": 0,
     }
   },
 
   get repository() {
-    delete Log.repository;
-    Log.repository = new LoggerRepository();
-    return Log.repository;
+    delete Log4Moz.repository;
+    Log4Moz.repository = new LoggerRepository();
+    return Log4Moz.repository;
   },
   set repository(value) {
-    delete Log.repository;
-    Log.repository = value;
+    delete Log4Moz.repository;
+    Log4Moz.repository = value;
   },
 
   LogMessage: LogMessage,
   Logger: Logger,
   LoggerRepository: LoggerRepository,
 
   Formatter: Formatter,
   BasicFormatter: BasicFormatter,
@@ -75,36 +74,36 @@ this.Log = {
   DumpAppender: DumpAppender,
   ConsoleAppender: ConsoleAppender,
   StorageStreamAppender: StorageStreamAppender,
 
   FileAppender: FileAppender,
   BoundedFileAppender: BoundedFileAppender,
 
   // Logging helper:
-  // let logger = Log.repository.getLogger("foo");
-  // logger.info(Log.enumerateInterfaces(someObject).join(","));
-  enumerateInterfaces: function Log_enumerateInterfaces(aObject) {
+  // let logger = Log4Moz.repository.getLogger("foo");
+  // logger.info(Log4Moz.enumerateInterfaces(someObject).join(","));
+  enumerateInterfaces: function Log4Moz_enumerateInterfaces(aObject) {
     let interfaces = [];
 
     for (i in Ci) {
       try {
         aObject.QueryInterface(Ci[i]);
         interfaces.push(i);
       }
       catch(ex) {}
     }
 
     return interfaces;
   },
 
   // Logging helper:
-  // let logger = Log.repository.getLogger("foo");
-  // logger.info(Log.enumerateProperties(someObject).join(","));
-  enumerateProperties: function Log_enumerateProps(aObject,
+  // let logger = Log4Moz.repository.getLogger("foo");
+  // logger.info(Log4Moz.enumerateProperties(someObject).join(","));
+  enumerateProperties: function Log4Moz_enumerateProps(aObject,
                                                        aExcludeComplexTypes) {
     let properties = [];
 
     for (p in aObject) {
       try {
         if (aExcludeComplexTypes &&
             (typeof aObject[p] == "object" || typeof aObject[p] == "function"))
           continue;
@@ -132,18 +131,18 @@ function LogMessage(loggerName, level, m
 
   // The _structured field will correspond to whether this message is to
   // be interpreted as a structured message.
   this._structured = this.params && this.params.action;
   this.time = Date.now();
 }
 LogMessage.prototype = {
   get levelDesc() {
-    if (this.level in Log.Level.Desc)
-      return Log.Level.Desc[this.level];
+    if (this.level in Log4Moz.Level.Desc)
+      return Log4Moz.Level.Desc[this.level];
     return "UNKNOWN";
   },
 
   toString: function LogMsg_toString(){
     let msg = "LogMessage [" + this.time + " " + this.level + " " +
       this.message;
     if (this.params) {
       msg += " " + JSON.stringify(this.params);
@@ -154,17 +153,17 @@ LogMessage.prototype = {
 
 /*
  * Logger
  * Hierarchical version.  Logs to all appenders, assigned or inherited
  */
 
 function Logger(name, repository) {
   if (!repository)
-    repository = Log.repository;
+    repository = Log4Moz.repository;
   this._name = name;
   this.children = [];
   this.ownAppenders = [];
   this.appenders = [];
   this._repository = repository;
 }
 Logger.prototype = {
   get name() {
@@ -172,18 +171,18 @@ Logger.prototype = {
   },
 
   _level: null,
   get level() {
     if (this._level != null)
       return this._level;
     if (this.parent)
       return this.parent.level;
-    dump("Log warning: root logger configuration error: no level defined\n");
-    return Log.Level.All;
+    dump("log4moz warning: root logger configuration error: no level defined\n");
+    return Log4Moz.Level.All;
   },
   set level(level) {
     this._level = level;
   },
 
   _parent: null,
   get parent() this._parent,
   set parent(parent) {
@@ -254,18 +253,18 @@ Logger.prototype = {
     if (!params) {
       return this.log(this.level, undefined, {"action": action});
     }
     if (typeof params != "object") {
       throw "The params argument is required to be an object.";
     }
 
     let level = params._level || this.level;
-    if ((typeof level == "string") && level in Log.Level.Numbers) {
-      level = Log.Level.Numbers[level];
+    if ((typeof level == "string") && level in Log4Moz.Level.Numbers) {
+      level = Log4Moz.Level.Numbers[level];
     }
 
     params.action = action;
     this.log(level, params._message, params);
   },
 
   log: function (level, string, params) {
     if (this.level > level)
@@ -282,52 +281,52 @@ Logger.prototype = {
       if (!message) {
         message = new LogMessage(this._name, level, string, params);
       }
       appender.append(message);
     }
   },
 
   fatal: function (string, params) {
-    this.log(Log.Level.Fatal, string, params);
+    this.log(Log4Moz.Level.Fatal, string, params);
   },
   error: function (string, params) {
-    this.log(Log.Level.Error, string, params);
+    this.log(Log4Moz.Level.Error, string, params);
   },
   warn: function (string, params) {
-    this.log(Log.Level.Warn, string, params);
+    this.log(Log4Moz.Level.Warn, string, params);
   },
   info: function (string, params) {
-    this.log(Log.Level.Info, string, params);
+    this.log(Log4Moz.Level.Info, string, params);
   },
   config: function (string, params) {
-    this.log(Log.Level.Config, string, params);
+    this.log(Log4Moz.Level.Config, string, params);
   },
   debug: function (string, params) {
-    this.log(Log.Level.Debug, string, params);
+    this.log(Log4Moz.Level.Debug, string, params);
   },
   trace: function (string, params) {
-    this.log(Log.Level.Trace, string, params);
+    this.log(Log4Moz.Level.Trace, string, params);
   }
 };
 
 /*
  * LoggerRepository
  * Implements a hierarchy of Loggers
  */
 
 function LoggerRepository() {}
 LoggerRepository.prototype = {
   _loggers: {},
 
   _rootLogger: null,
   get rootLogger() {
     if (!this._rootLogger) {
       this._rootLogger = new Logger("root", this);
-      this._rootLogger.level = Log.Level.All;
+      this._rootLogger.level = Log4Moz.Level.All;
     }
     return this._rootLogger;
   },
   set rootLogger(logger) {
     throw "Cannot change the root logger";
   },
 
   _updateParents: function LogRep__updateParents(name) {
@@ -432,17 +431,17 @@ StructuredFormatter.prototype = {
  * Simply subclass and override doAppend to implement a new one
  */
 
 function Appender(formatter) {
   this._name = "Appender";
   this._formatter = formatter? formatter : new BasicFormatter();
 }
 Appender.prototype = {
-  level: Log.Level.All,
+  level: Log4Moz.Level.All,
 
   append: function App_append(message) {
     if (message) {
       this.doAppend(this._formatter.format(message));
     }
   },
   toString: function App_toString() {
     return this._name + " [level=" + this._level +
@@ -476,17 +475,17 @@ DumpAppender.prototype = {
 function ConsoleAppender(formatter) {
   this._name = "ConsoleAppender";
   Appender.call(this, formatter);
 }
 ConsoleAppender.prototype = {
   __proto__: Appender.prototype,
 
   doAppend: function CApp_doAppend(message) {
-    if (message.level > Log.Level.Warn) {
+    if (message.level > Log4Moz.Level.Warn) {
       Cu.reportError(message);
       return;
     }
     Cc["@mozilla.org/consoleservice;1"].
       getService(Ci.nsIConsoleService).logStringMessage(message);
   }
 };
 
--- a/services/common/modules-testing/bagheeraserver.js
+++ b/services/common/modules-testing/bagheeraserver.js
@@ -3,32 +3,32 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {utils: Cu} = Components;
 
 this.EXPORTED_SYMBOLS = ["BagheeraServer"];
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://testing-common/httpd.js");
 
 
 /**
  * This is an implementation of the Bagheera server.
  *
  * The purpose of the server is to facilitate testing of the Bagheera
  * client and the Firefox Health report. It is *not* meant to be a
  * production grade server.
  *
  * The Bagheera server is essentially a glorified document store.
  */
 this.BagheeraServer = function BagheeraServer() {
-  this._log = Log.repository.getLogger("metrics.BagheeraServer");
+  this._log = Log4Moz.repository.getLogger("metrics.BagheeraServer");
 
   this.server = new HttpServer();
   this.namespaces = {};
 
   this.allowAllNamespaces = false;
 }
 
 BagheeraServer.prototype = {
--- a/services/common/modules-testing/logging.js
+++ b/services/common/modules-testing/logging.js
@@ -6,49 +6,49 @@
 
 this.EXPORTED_SYMBOLS = [
   "getTestLogger",
   "initTestLogging",
 ];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 this.initTestLogging = function initTestLogging(level) {
   function LogStats() {
     this.errorsLogged = 0;
   }
   LogStats.prototype = {
     format: function format(message) {
-      if (message.level == Log.Level.Error) {
+      if (message.level == Log4Moz.Level.Error) {
         this.errorsLogged += 1;
       }
 
       return message.loggerName + "\t" + message.levelDesc + "\t" +
         message.message + "\n";
     }
   };
-  LogStats.prototype.__proto__ = new Log.Formatter();
+  LogStats.prototype.__proto__ = new Log4Moz.Formatter();
 
-  let log = Log.repository.rootLogger;
+  let log = Log4Moz.repository.rootLogger;
   let logStats = new LogStats();
-  let appender = new Log.DumpAppender(logStats);
+  let appender = new Log4Moz.DumpAppender(logStats);
 
   if (typeof(level) == "undefined") {
     level = "Debug";
   }
-  getTestLogger().level = Log.Level[level];
-  Log.repository.getLogger("Services").level = Log.Level[level];
+  getTestLogger().level = Log4Moz.Level[level];
+  Log4Moz.repository.getLogger("Services").level = Log4Moz.Level[level];
 
-  log.level = Log.Level.Trace;
-  appender.level = Log.Level.Trace;
+  log.level = Log4Moz.Level.Trace;
+  appender.level = Log4Moz.Level.Trace;
   // Overwrite any other appenders (e.g. from previous incarnations)
   log.ownAppenders = [appender];
   log.updateAppenders();
 
   return logStats;
 }
 
 this.getTestLogger = function getTestLogger(component) {
-  return Log.repository.getLogger("Testing");
+  return Log4Moz.repository.getLogger("Testing");
 }
 
--- a/services/common/modules-testing/storageserver.js
+++ b/services/common/modules-testing/storageserver.js
@@ -15,17 +15,17 @@ this.EXPORTED_SYMBOLS = [
   "StorageServerCallback",
   "StorageServerCollection",
   "StorageServer",
   "storageServerForUsers",
 ];
 
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 const STORAGE_HTTP_LOGGER = "Services.Common.Test.Server";
 const STORAGE_API_VERSION = "2.0";
 
 // Use the same method that record.js does, which mirrors the server.
 function new_timestamp() {
   return Math.round(Date.now());
@@ -69,17 +69,17 @@ this.ServerBSO = function ServerBSO(id, 
   if (!id) {
     throw new Error("No ID for ServerBSO!");
   }
 
   if (!id.match(/^[a-zA-Z0-9_-]{1,64}$/)) {
     throw new Error("BSO ID is invalid: " + id);
   }
 
-  this._log = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
+  this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
 
   this.id = id;
   if (!payload) {
     return;
   }
 
   CommonUtils.ensureMillisecondsTimestamp(modified);
 
@@ -282,17 +282,17 @@ this.StorageServerCollection =
   /*
    * Track modified timestamp.
    * We can't just use the timestamps of contained BSOs: an empty collection
    * has a modified time.
    */
   CommonUtils.ensureMillisecondsTimestamp(timestamp);
   this._timestamp = timestamp;
 
-  this._log = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
+  this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
 }
 StorageServerCollection.prototype = {
   BATCH_MAX_COUNT: 100,         // # of records.
   BATCH_MAX_SIZE: 1024 * 1024,  // # bytes.
 
   _timestamp: null,
 
   get timestamp() {
@@ -867,17 +867,17 @@ this.StorageServerCallback = {
  * StorageServerCallback) as input.
  */
 this.StorageServer = function StorageServer(callback) {
   this.callback     = callback || {__proto__: StorageServerCallback};
   this.server       = new HttpServer();
   this.started      = false;
   this.users        = {};
   this.requestCount = 0;
-  this._log         = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
+  this._log         = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
 
   // Install our own default handler. This allows us to mess around with the
   // whole URL space.
   let handler = this.server._handler;
   handler._handleDefault = this.handleDefault.bind(this, handler);
 }
 StorageServer.prototype = {
   DEFAULT_QUOTA: 1024 * 1024, // # bytes.
--- a/services/common/rest.js
+++ b/services/common/rest.js
@@ -12,17 +12,17 @@ this.EXPORTED_SYMBOLS = [
   "TokenAuthenticatedRESTRequest"
 ];
 
 #endif
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils",
                                   "resource://services-crypto/utils.js");
 
 const Prefs = new Preferences("services.common.rest.");
 
 /**
@@ -86,19 +86,19 @@ this.RESTRequest = function RESTRequest(
   // If we don't have an nsIURI object yet, make one. This will throw if
   // 'uri' isn't a valid URI string.
   if (!(uri instanceof Ci.nsIURI)) {
     uri = Services.io.newURI(uri, null, null);
   }
   this.uri = uri;
 
   this._headers = {};
-  this._log = Log.repository.getLogger(this._logName);
+  this._log = Log4Moz.repository.getLogger(this._logName);
   this._log.level =
-    Log.Level[Prefs.get("log.logger.rest.request")];
+    Log4Moz.Level[Prefs.get("log.logger.rest.request")];
 }
 RESTRequest.prototype = {
 
   _logName: "Services.Common.RESTRequest",
 
   QueryInterface: XPCOMUtils.generateQI([
     Ci.nsIBadCertListener2,
     Ci.nsIInterfaceRequestor,
@@ -304,17 +304,17 @@ RESTRequest.prototype = {
     // Set HTTP request body.
     if (method == "PUT" || method == "POST") {
       // Convert non-string bodies into JSON.
       if (typeof data != "string") {
         data = JSON.stringify(data);
       }
 
       this._log.debug(method + " Length: " + data.length);
-      if (this._log.level <= Log.Level.Trace) {
+      if (this._log.level <= Log4Moz.Level.Trace) {
         this._log.trace(method + " Body: " + data);
       }
 
       let stream = Cc["@mozilla.org/io/string-input-stream;1"]
                      .createInstance(Ci.nsIStringInputStream);
       stream.setData(data, data.length);
 
       let type = headers["content-type"] || "text/plain";
@@ -439,17 +439,17 @@ RESTRequest.prototype = {
       this.onComplete(error);
       this.onComplete = this.onProgress = null;
       return;
     }
 
     this._log.debug(this.method + " " + uri + " " + this.response.status);
 
     // Additionally give the full response body when Trace logging.
-    if (this._log.level <= Log.Level.Trace) {
+    if (this._log.level <= Log4Moz.Level.Trace) {
       this._log.trace(this.method + " body: " + this.response.body);
     }
 
     delete this._inputStream;
 
     this.onComplete(null);
     this.onComplete = this.onProgress = null;
   },
@@ -588,19 +588,19 @@ RESTRequest.prototype = {
   }
 };
 
 /**
  * Response object for a RESTRequest. This will be created automatically by
  * the RESTRequest.
  */
 this.RESTResponse = function RESTResponse() {
-  this._log = Log.repository.getLogger(this._logName);
+  this._log = Log4Moz.repository.getLogger(this._logName);
   this._log.level =
-    Log.Level[Prefs.get("log.logger.rest.response")];
+    Log4Moz.Level[Prefs.get("log.logger.rest.response")];
 }
 RESTResponse.prototype = {
 
   _logName: "Sync.RESTResponse",
 
   /**
    * Corresponding REST request
    */
--- a/services/common/storageservice.js
+++ b/services/common/storageservice.js
@@ -30,17 +30,17 @@ this.EXPORTED_SYMBOLS = [
   "StorageServiceClient",
   "StorageServiceRequestError",
 ];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-common/utils.js");
 
 const Prefs = new Preferences("services.common.storageservice.");
 
 /**
  * The data type stored in the storage service.
  *
@@ -465,18 +465,18 @@ this.StorageServiceRequestError = functi
  * Future Features
  * ---------------
  *
  * The current implementation does not support true streaming for things like
  * multi-BSO retrieval. However, the API supports it, so we should be able
  * to implement it transparently.
  */
 function StorageServiceRequest() {
-  this._log = Log.repository.getLogger("Sync.StorageService.Request");
-  this._log.level = Log.Level[Prefs.get("log.level")];
+  this._log = Log4Moz.repository.getLogger("Sync.StorageService.Request");
+  this._log.level = Log4Moz.Level[Prefs.get("log.level")];
 
   this.notModified = false;
 
   this._client                 = null;
   this._request                = null;
   this._method                 = null;
   this._handler                = {};
   this._data                   = null;
@@ -1516,18 +1516,18 @@ Object.freeze(StorageCollectionBatchedDe
  * Storage API consumers almost certainly have added functionality on top of the
  * storage service. It is encouraged to create a child type which adds
  * functionality to this layer.
  *
  * @param baseURI
  *        (string) Base URI for all requests.
  */
 this.StorageServiceClient = function StorageServiceClient(baseURI) {
-  this._log = Log.repository.getLogger("Services.Common.StorageServiceClient");
-  this._log.level = Log.Level[Prefs.get("log.level")];
+  this._log = Log4Moz.repository.getLogger("Services.Common.StorageServiceClient");
+  this._log.level = Log4Moz.Level[Prefs.get("log.level")];
 
   this._baseURI = baseURI;
 
   if (this._baseURI[this._baseURI.length-1] != "/") {
     this._baseURI += "/";
   }
 
   this._log.info("Creating new StorageServiceClient under " + this._baseURI);
--- a/services/common/tests/unit/head_helpers.js
+++ b/services/common/tests/unit/head_helpers.js
@@ -1,19 +1,19 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://testing-common/httpd.js");
 Cu.import("resource://testing-common/services-common/logging.js");
 
-let btoa = Cu.import("resource://gre/modules/Log.jsm").btoa;
-let atob = Cu.import("resource://gre/modules/Log.jsm").atob;
+let btoa = Cu.import("resource://services-common/log4moz.js").btoa;
+let atob = Cu.import("resource://services-common/log4moz.js").atob;
 
 function do_check_empty(obj) {
   do_check_attribute_count(obj, 0);
 }
 
 function do_check_attribute_count(obj, c) {
   do_check_eq(c, Object.keys(obj).length);
 }
--- a/services/common/tests/unit/test_load_modules.js
+++ b/services/common/tests/unit/test_load_modules.js
@@ -1,14 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const modules = [
   "async.js",
   "bagheeraclient.js",
+  "log4moz.js",
   "rest.js",
   "storageservice.js",
   "stringbundle.js",
   "tokenserverclient.js",
   "utils.js",
 ];
 
 const test_modules = [
rename from toolkit/modules/tests/xpcshell/test_Log.js
rename to services/common/tests/unit/test_log4moz.js
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ b/services/common/tests/unit/test_log4moz.js
@@ -1,75 +1,73 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-const {utils: Cu} = Components;
-
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 let testFormatter = {
   format: function format(message) {
     return message.loggerName + "\t" +
       message.levelDesc + "\t" +
       message.message + "\n";
   }
 };
 
 function MockAppender(formatter) {
-  Log.Appender.call(this, formatter);
+  Log4Moz.Appender.call(this, formatter);
   this.messages = [];
 }
 MockAppender.prototype = {
-  __proto__: Log.Appender.prototype,
+  __proto__: Log4Moz.Appender.prototype,
 
   doAppend: function DApp_doAppend(message) {
     this.messages.push(message);
   }
 };
 
 function run_test() {
   run_next_test();
 }
 
 add_test(function test_Logger() {
-  let log = Log.repository.getLogger("test.logger");
-  let appender = new MockAppender(new Log.BasicFormatter());
+  let log = Log4Moz.repository.getLogger("test.logger");
+  let appender = new MockAppender(new Log4Moz.BasicFormatter());
 
-  log.level = Log.Level.Debug;
-  appender.level = Log.Level.Info;
+  log.level = Log4Moz.Level.Debug;
+  appender.level = Log4Moz.Level.Info;
   log.addAppender(appender);
   log.info("info test");
   log.debug("this should be logged but not appended.");
 
   do_check_eq(appender.messages.length, 1);
 
   let msgRe = /\d+\ttest.logger\t\INFO\tinfo test/;
   do_check_true(msgRe.test(appender.messages[0]));
 
   run_next_test();
 });
 
 add_test(function test_Logger_parent() {
   // Check whether parenting is correct
-  let grandparentLog = Log.repository.getLogger("grandparent");
-  let childLog = Log.repository.getLogger("grandparent.parent.child");
+  let grandparentLog = Log4Moz.repository.getLogger("grandparent");
+  let childLog = Log4Moz.repository.getLogger("grandparent.parent.child");
   do_check_eq(childLog.parent.name, "grandparent");
 
-  let parentLog = Log.repository.getLogger("grandparent.parent");
+  let parentLog = Log4Moz.repository.getLogger("grandparent.parent");
   do_check_eq(childLog.parent.name, "grandparent.parent");
 
   // Check that appends are exactly in scope
-  let gpAppender = new MockAppender(new Log.BasicFormatter());
-  gpAppender.level = Log.Level.Info;
+  let gpAppender = new MockAppender(new Log4Moz.BasicFormatter());
+  gpAppender.level = Log4Moz.Level.Info;
   grandparentLog.addAppender(gpAppender);
   childLog.info("child info test");
-  Log.repository.rootLogger.info("this shouldn't show up in gpAppender");
+  Log4Moz.repository.rootLogger.info("this shouldn't show up in gpAppender");
 
   do_check_eq(gpAppender.messages.length, 1);
   do_check_true(gpAppender.messages[0].indexOf("child info test") > 0);
 
   run_next_test();
 });
 
 // A utility method for checking object equivalence.
@@ -93,52 +91,52 @@ function checkObjects(expected, actual) 
   }
 
   for (let key in actual) {
     do_check_neq(expected[key], undefined);
   }
 }
 
 add_test(function test_StructuredLogCommands() {
-  let appender = new MockAppender(new Log.StructuredFormatter());
-  let logger = Log.repository.getLogger("test.StructuredOutput");
+  let appender = new MockAppender(new Log4Moz.StructuredFormatter());
+  let logger = Log4Moz.repository.getLogger("test.StructuredOutput");
   logger.addAppender(appender);
-  logger.level = Log.Level.Info;
+  logger.level = Log4Moz.Level.Info;
 
   logger.logStructured("test_message", {_message: "message string one"});
   logger.logStructured("test_message", {_message: "message string two",
                                         _level: "ERROR",
-                                        source_file: "test_Log.js"});
+                                        source_file: "test_log4moz.js"});
   logger.logStructured("test_message");
-  logger.logStructured("test_message", {source_file: "test_Log.js",
+  logger.logStructured("test_message", {source_file: "test_log4moz.js",
                                         message_position: 4});
 
   let messageOne = {"_time": /\d+/,
                     "_namespace": "test.StructuredOutput",
                     "_level": "INFO",
                     "_message": "message string one",
                     "action": "test_message"};
 
   let messageTwo = {"_time": /\d+/,
                     "_namespace": "test.StructuredOutput",
                     "_level": "ERROR",
                     "_message": "message string two",
                     "action": "test_message",
-                    "source_file": "test_Log.js"};
+                    "source_file": "test_log4moz.js"};
 
   let messageThree = {"_time": /\d+/,
                       "_namespace": "test.StructuredOutput",
                       "_level": "INFO",
                       "action": "test_message"};
 
   let messageFour = {"_time": /\d+/,
                      "_namespace": "test.StructuredOutput",
                      "_level": "INFO",
                      "action": "test_message",
-                     "source_file": "test_Log.js",
+                     "source_file": "test_log4moz.js",
                      "message_position": 4};
 
   checkObjects(messageOne, JSON.parse(appender.messages[0]));
   checkObjects(messageTwo, JSON.parse(appender.messages[1]));
   checkObjects(messageThree, JSON.parse(appender.messages[2]));
   checkObjects(messageFour, JSON.parse(appender.messages[3]));
 
   let errored = false;
@@ -158,39 +156,39 @@ add_test(function test_StructuredLogComm
     errored = true;
     do_check_eq(e, "The params argument is required to be an object.");
   } finally {
     do_check_true(errored);
   }
 
   // Logging with unstructured interface should produce the same messages
   // as the structured interface for these cases.
-  let appender = new MockAppender(new Log.StructuredFormatter());
-  let logger = Log.repository.getLogger("test.StructuredOutput1");
+  let appender = new MockAppender(new Log4Moz.StructuredFormatter());
+  let logger = Log4Moz.repository.getLogger("test.StructuredOutput1");
   messageOne._namespace = "test.StructuredOutput1";
   messageTwo._namespace = "test.StructuredOutput1";
   logger.addAppender(appender);
-  logger.level = Log.Level.All;
+  logger.level = Log4Moz.Level.All;
   logger.info("message string one", {action: "test_message"});
   logger.error("message string two", {action: "test_message",
-                                      source_file: "test_Log.js"});
+                                      source_file: "test_log4moz.js"});
 
   checkObjects(messageOne, JSON.parse(appender.messages[0]));
   checkObjects(messageTwo, JSON.parse(appender.messages[1]));
 
   run_next_test();
 });
 
 add_test(function test_StorageStreamAppender() {
-  let appender = new Log.StorageStreamAppender(testFormatter);
+  let appender = new Log4Moz.StorageStreamAppender(testFormatter);
   do_check_eq(appender.getInputStream(), null);
 
   // Log to the storage stream and verify the log was written and can be
   // read back.
-  let logger = Log.repository.getLogger("test.StorageStreamAppender");
+  let logger = Log4Moz.repository.getLogger("test.StorageStreamAppender");
   logger.addAppender(appender);
   logger.info("OHAI");
   let inputStream = appender.getInputStream();
   let data = NetUtil.readInputStreamToString(inputStream,
                                              inputStream.available());
   do_check_eq(data, "test.StorageStreamAppender\tINFO\tOHAI\n");
 
   // We can read it again even.
@@ -215,21 +213,21 @@ function fileContents(path) {
   let decoder = new TextDecoder();
   return OS.File.read(path).then(array => {
     return decoder.decode(array);
   });
 }
 
 add_task(function test_FileAppender() {
   // This directory does not exist yet
-  let dir = OS.Path.join(do_get_profile().path, "test_Log");
+  let dir = OS.Path.join(do_get_profile().path, "test_log4moz");
   do_check_false(yield OS.File.exists(dir));
   let path = OS.Path.join(dir, "test_FileAppender");
-  let appender = new Log.FileAppender(path, testFormatter);
-  let logger = Log.repository.getLogger("test.FileAppender");
+  let appender = new Log4Moz.FileAppender(path, testFormatter);
+  let logger = Log4Moz.repository.getLogger("test.FileAppender");
   logger.addAppender(appender);
 
   // Logging to a file that can't be created won't do harm.
   do_check_false(yield OS.File.exists(path));
   logger.info("OHAI!");
 
   yield OS.File.makeDir(dir);
   logger.info("OHAI");
@@ -268,21 +266,21 @@ add_task(function test_FileAppender() {
               "test.FileAppender\tDEBUG\t1\n" +
               "test.FileAppender\tINFO\t2\n" +
               "test.FileAppender\tINFO\t3\n" +
               "test.FileAppender\tINFO\t4\n" +
               "test.FileAppender\tINFO\t5\n");
 });
 
 add_task(function test_BoundedFileAppender() {
-  let dir = OS.Path.join(do_get_profile().path, "test_Log");
+  let dir = OS.Path.join(do_get_profile().path, "test_log4moz");
   let path = OS.Path.join(dir, "test_BoundedFileAppender");
   // This appender will hold about two lines at a time.
-  let appender = new Log.BoundedFileAppender(path, testFormatter, 40);
-  let logger = Log.repository.getLogger("test.BoundedFileAppender");
+  let appender = new Log4Moz.BoundedFileAppender(path, testFormatter, 40);
+  let logger = Log4Moz.repository.getLogger("test.BoundedFileAppender");
   logger.addAppender(appender);
 
   logger.info("ONE");
   logger.info("TWO");
   yield appender._lastWritePromise;
 
   do_check_eq((yield fileContents(path)),
               "test.BoundedFileAppender\tINFO\tONE\n" +
--- a/services/common/tests/unit/test_restrequest.js
+++ b/services/common/tests/unit/test_restrequest.js
@@ -1,21 +1,21 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-common/utils.js");
 
 //DEBUG = true;
 
 function run_test() {
-  Log.repository.getLogger("Services.Common.RESTRequest").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Services.Common.RESTRequest").level =
+    Log4Moz.Level.Trace;
   initTestLogging("Trace");
 
   run_next_test();
 }
 
 /**
  * Initializing a RESTRequest with an invalid URI throws
  * NS_ERROR_MALFORMED_URI.
--- a/services/common/tests/unit/test_storage_server.js
+++ b/services/common/tests/unit/test_storage_server.js
@@ -100,18 +100,18 @@ function doPutRequest(request, data) {
 function doDeleteRequest(request) {
   let cb = Async.makeSpinningCallback();
   request.delete(cb);
 
   return waitAndValidateResponse(cb, request);
 }
 
 function run_test() {
-  Log.repository.getLogger("Services.Common.Test.StorageServer").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Services.Common.Test.StorageServer").level =
+    Log4Moz.Level.Trace;
   initTestLogging();
 
   run_next_test();
 }
 
 add_test(function test_creation() {
   _("Ensure a simple server can be created.");
 
--- a/services/common/tests/unit/xpcshell.ini
+++ b/services/common/tests/unit/xpcshell.ini
@@ -20,16 +20,17 @@ firefox-appdir = browser
 [test_utils_stackTrace.js]
 [test_utils_utf8.js]
 [test_utils_uuid.js]
 
 [test_async_chain.js]
 [test_async_querySpinningly.js]
 [test_bagheera_server.js]
 [test_bagheera_client.js]
+[test_log4moz.js]
 [test_observers.js]
 [test_restrequest.js]
 [test_tokenauthenticatedrequest.js]
 
 # Storage service APIs
 [test_storageservice_bso.js]
 [test_storageservice_client.js]
 
--- a/services/common/tokenserverclient.js
+++ b/services/common/tokenserverclient.js
@@ -9,17 +9,17 @@ this.EXPORTED_SYMBOLS = [
   "TokenServerClientError",
   "TokenServerClientNetworkError",
   "TokenServerClientServerError",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-common/utils.js");
 
 const Prefs = new Preferences("services.common.tokenserverclient.");
 
 /**
  * Represents a TokenServerClient error that occurred on the client.
  *
@@ -109,18 +109,18 @@ TokenServerClientServerError.prototype.c
  *
  *  - The server sends a JSON response on error. The client does not currently
  *    parse this. It might be convenient if it did.
  *  - Currently most non-200 status codes are rolled into one error type. It
  *    might be helpful if callers had a richer API that communicated who was
  *    at fault (e.g. differentiating a 503 from a 401).
  */
 this.TokenServerClient = function TokenServerClient() {
-  this._log = Log.repository.getLogger("Common.TokenServerClient");
-  this._log.level = Log.Level[Prefs.get("logger.level")];
+  this._log = Log4Moz.repository.getLogger("Common.TokenServerClient");
+  this._log.level = Log4Moz.Level[Prefs.get("logger.level")];
 }
 TokenServerClient.prototype = {
   /**
    * Logger instance.
    */
   _log: null,
 
   /**
--- a/services/common/utils.js
+++ b/services/common/utils.js
@@ -5,17 +5,17 @@
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 this.EXPORTED_SYMBOLS = ["CommonUtils"];
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/osfile.jsm")
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 this.CommonUtils = {
   exceptionStr: function exceptionStr(e) {
     if (!e) {
       return "" + e;
     }
     let message = e.message ? e.message : e;
     return message + " " + CommonUtils.stackTrace(e);
@@ -83,17 +83,17 @@ this.CommonUtils = {
    * Create a nsIURI instance from a string.
    */
   makeURI: function makeURI(URIString) {
     if (!URIString)
       return null;
     try {
       return Services.io.newURI(URIString, null, null);
     } catch (e) {
-      let log = Log.repository.getLogger("Common.Utils");
+      let log = Log4Moz.repository.getLogger("Common.Utils");
       log.debug("Could not create URI: " + CommonUtils.exceptionStr(e));
       return null;
     }
   },
 
   /**
    * Execute a function on the next event loop tick.
    *
@@ -459,17 +459,17 @@ this.CommonUtils = {
    *
    * @param branch
    *        (Preferences) Branch from which to retrieve preference.
    * @param pref
    *        (string) The preference to read from.
    * @param def
    *        (Number) The default value to use if the preference is not defined.
    * @param log
-   *        (Log.Logger) Logger to write warnings to.
+   *        (Log4Moz.Logger) Logger to write warnings to.
    */
   getEpochPref: function getEpochPref(branch, pref, def=0, log=null) {
     if (!Number.isInteger(def)) {
       throw new Error("Default value is not a number: " + def);
     }
 
     let valueStr = branch.get(pref, null);
 
@@ -502,17 +502,17 @@ this.CommonUtils = {
    * @param branch
    *        (Preferences) Branch from which to read preference.
    * @param pref
    *        (string) The preference from which to read.
    * @param def
    *        (Number) The default value (in milliseconds) if the preference is
    *        not defined or invalid.
    * @param log
-   *        (Log.Logger) Logger to write warnings to.
+   *        (Log4Moz.Logger) Logger to write warnings to.
    * @param oldestYear
    *        (Number) Oldest year to accept in read values.
    */
   getDatePref: function getDatePref(branch, pref, def=0, log=null,
                                     oldestYear=2010) {
 
     let valueInt = this.getEpochPref(branch, pref, def, log);
     let date = new Date(valueInt);
--- a/services/datareporting/DataReportingService.js
+++ b/services/datareporting/DataReportingService.js
@@ -218,47 +218,47 @@ DataReportingService.prototype = Object.
   },
 
   _loadHealthReporter: function () {
     let ns = {};
     // Lazy import so application startup isn't adversely affected.
 
     Cu.import("resource://gre/modules/Task.jsm", ns);
     Cu.import("resource://gre/modules/HealthReport.jsm", ns);
-    Cu.import("resource://gre/modules/Log.jsm", ns);
+    Cu.import("resource://services-common/log4moz.js", ns);
 
     // How many times will we rewrite this code before rolling it up into a
     // generic module? See also bug 451283.
     const LOGGERS = [
       "Services.DataReporting",
       "Services.HealthReport",
       "Services.Metrics",
       "Services.BagheeraClient",
       "Sqlite.Connection.healthreport",
     ];
 
     let loggingPrefs = new Preferences(HEALTHREPORT_LOGGING_BRANCH);
     if (loggingPrefs.get("consoleEnabled", true)) {
       let level = loggingPrefs.get("consoleLevel", "Warn");
-      let appender = new ns.Log.ConsoleAppender();
-      appender.level = ns.Log.Level[level] || ns.Log.Level.Warn;
+      let appender = new ns.Log4Moz.ConsoleAppender();
+      appender.level = ns.Log4Moz.Level[level] || ns.Log4Moz.Level.Warn;
 
       for (let name of LOGGERS) {
-        let logger = ns.Log.repository.getLogger(name);
+        let logger = ns.Log4Moz.repository.getLogger(name);
         logger.addAppender(appender);
       }
     }
 
     if (loggingPrefs.get("dumpEnabled", false)) {
       let level = loggingPrefs.get("dumpLevel", "Debug");
-      let appender = new ns.Log.DumpAppender();
-      appender.level = ns.Log.Level[level] || ns.Log.Level.Debug;
+      let appender = new ns.Log4Moz.DumpAppender();
+      appender.level = ns.Log4Moz.Level[level] || ns.Log4Moz.Level.Debug;
 
       for (let name of LOGGERS) {
-        let logger = ns.Log.repository.getLogger(name);
+        let logger = ns.Log4Moz.repository.getLogger(name);
         logger.addAppender(appender);
       }
     }
 
     this._healthReporter = new ns.HealthReporter(HEALTHREPORT_BRANCH,
                                                  this.policy,
                                                  this.sessionRecorder);
 
--- a/services/datareporting/modules-testing/mocks.jsm
+++ b/services/datareporting/modules-testing/mocks.jsm
@@ -3,22 +3,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["MockPolicyListener"];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 
 this.MockPolicyListener = function MockPolicyListener() {
-  this._log = Log.repository.getLogger("Services.DataReporting.Testing.MockPolicyListener");
-  this._log.level = Log.Level["Debug"];
+  this._log = Log4Moz.repository.getLogger("Services.DataReporting.Testing.MockPolicyListener");
+  this._log.level = Log4Moz.Level["Debug"];
 
   this.requestDataUploadCount = 0;
   this.lastDataRequest = null;
 
   this.requestRemoteDeleteCount = 0;
   this.lastRemoteDeleteRequest = null;
 
   this.notifyUserCount = 0;
--- a/services/datareporting/policy.jsm
+++ b/services/datareporting/policy.jsm
@@ -22,17 +22,17 @@ this.EXPORTED_SYMBOLS = [
   "DataReportingPolicy",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 #endif
 
 Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 // Used as a sanity lower bound for dates stored in prefs. This module was
 // implemented in 2012, so any earlier dates indicate an incorrect clock.
 const OLDEST_ALLOWED_YEAR = 2012;
 
@@ -258,18 +258,18 @@ this.DataSubmissionRequest.prototype = O
  *        queried and stored.
  * @param healthReportPrefs
  *        (Preferences) Handle on preferences branch holding Health Report state.
  * @param listener
  *        (object) Object with callbacks that will be invoked at certain key
  *        events.
  */
 this.DataReportingPolicy = function (prefs, healthReportPrefs, listener) {
-  this._log = Log.repository.getLogger("Services.DataReporting.Policy");
-  this._log.level = Log.Level["Debug"];
+  this._log = Log4Moz.repository.getLogger("Services.DataReporting.Policy");
+  this._log.level = Log4Moz.Level["Debug"];
 
   for (let handler of this.REQUIRED_LISTENERS) {
     if (!listener[handler]) {
       throw new Error("Passed listener does not contain required handler: " +
                       handler);
     }
   }
 
--- a/services/datareporting/sessions.jsm
+++ b/services/datareporting/sessions.jsm
@@ -11,17 +11,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 #endif
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 // We automatically prune sessions older than this.
 const MAX_SESSION_AGE_MS = 7 * 24 * 60 * 60 * 1000; // 7 days.
 const STARTUP_RETRY_INTERVAL_MS = 5000;
 
 // Wait up to 5 minutes for startup measurements before giving up.
@@ -64,17 +64,17 @@ this.SessionRecorder = function (branch)
   if (!branch) {
     throw new Error("branch argument must be defined.");
   }
 
   if (!branch.endsWith(".")) {
     throw new Error("branch argument must end with '.': " + branch);
   }
 
-  this._log = Log.repository.getLogger("Services.DataReporting.SessionRecorder");
+  this._log = Log4Moz.repository.getLogger("Services.DataReporting.SessionRecorder");
 
   this._prefs = new Preferences(branch);
   this._lastActivityWasInactive = false;
   this._activeTicks = 0;
   this.fineTotalTime = 0;
   this._started = false;
   this._timer = null;
   this._startupFieldTries = 0;
--- a/services/healthreport/healthreporter.jsm
+++ b/services/healthreport/healthreporter.jsm
@@ -13,17 +13,17 @@ const {classes: Cc, interfaces: Ci, util
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 Cu.import("resource://gre/modules/Metrics.jsm");
 Cu.import("resource://services-common/async.js");
 
 Cu.import("resource://services-common/bagheeraclient.js");
 #endif
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
 Cu.import("resource://gre/modules/TelemetryStopwatch.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -255,17 +255,17 @@ function AbstractHealthReporter(branch, 
   if (!branch.endsWith(".")) {
     throw new Error("Branch must end with a period (.): " + branch);
   }
 
   if (!policy) {
     throw new Error("Must provide policy to HealthReporter constructor.");
   }
 
-  this._log = Log.repository.getLogger("Services.HealthReport.HealthReporter");
+  this._log = Log4Moz.repository.getLogger("Services.HealthReport.HealthReporter");
   this._log.info("Initializing health reporter instance against " + branch);
 
   this._branch = branch;
   this._prefs = new Preferences(branch);
 
   this._policy = policy;
   this.sessionRecorder = sessionRecorder;
 
--- a/services/healthreport/profile.jsm
+++ b/services/healthreport/profile.jsm
@@ -20,17 +20,17 @@ Cu.import("resource://gre/modules/Metric
 #endif
 
 const DEFAULT_PROFILE_MEASUREMENT_NAME = "age";
 const REQUIRED_UINT32_TYPE = {type: "TYPE_UINT32"};
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/osfile.jsm")
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 // Profile creation time access.
 // This is separate from the provider to simplify testing and enable extraction
 // to a shared location in the future.
 this.ProfileCreationTimeAccessor = function(profile, log) {
   this.profilePath = profile || OS.Constants.Path.profileDir;
   if (!this.profilePath) {
--- a/services/metrics/dataprovider.jsm
+++ b/services/metrics/dataprovider.jsm
@@ -15,17 +15,17 @@ const {utils: Cu} = Components;
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 #endif
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 
 /**
  * Represents a collection of related pieces/fields of data.
  *
  * This is an abstract base type.
@@ -81,17 +81,17 @@ this.Measurement = function () {
       throw new Error("Field does not contain metadata: " + name);
     }
 
     if (!info.type) {
       throw new Error("Field is missing required type property: " + name);
     }
   }
 
-  this._log = Log.repository.getLogger("Services.Metrics.Measurement." + this.name);
+  this._log = Log4Moz.repository.getLogger("Services.Metrics.Measurement." + this.name);
 
   this.id = null;
   this.storage = null;
   this._fields = {};
 
   this._serializers = {};
   this._serializers[this.SERIALIZE_JSON] = {
     singular: this._serializeJSONSingular.bind(this),
@@ -497,17 +497,17 @@ this.Provider = function () {
   if (!this.name) {
     throw new Error("Provider must define a name.");
   }
 
   if (!Array.isArray(this.measurementTypes)) {
     throw new Error("Provider must define measurement types.");
   }
 
-  this._log = Log.repository.getLogger("Services.Metrics.Provider." + this.name);
+  this._log = Log4Moz.repository.getLogger("Services.Metrics.Provider." + this.name);
 
   this.measurements = null;
   this.storage = null;
 }
 
 Provider.prototype = Object.freeze({
   /**
    * Whether the provider only pulls data from other sources.
--- a/services/metrics/providermanager.jsm
+++ b/services/metrics/providermanager.jsm
@@ -9,28 +9,28 @@ this.EXPORTED_SYMBOLS = ["ProviderManage
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/services/metrics/dataprovider.jsm");
 #endif
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 /**
  * Handles and coordinates the collection of metrics data from providers.
  *
  * This provides an interface for managing `Metrics.Provider` instances. It
  * provides APIs for bulk collection of data.
  */
 this.ProviderManager = function (storage) {
-  this._log = Log.repository.getLogger("Services.Metrics.ProviderManager");
+  this._log = Log4Moz.repository.getLogger("Services.Metrics.ProviderManager");
 
   this._providers = new Map();
   this._storage = storage;
 
   this._providerInitQueue = [];
   this._providerInitializing = false;
 
   this._pullOnlyProviders = {};
--- a/services/metrics/storage.jsm
+++ b/services/metrics/storage.jsm
@@ -17,17 +17,17 @@ const {utils: Cu} = Components;
 
 const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
 
 #endif
 
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/Sqlite.jsm");
 Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 
 
 // These do not account for leap seconds. Meh.
 function dateToDays(date) {
   return Math.floor(date.getTime() / MILLISECONDS_PER_DAY);
 }
 
@@ -693,17 +693,17 @@ this.MetricsStorageBackend = function (p
  * Instances of this should be obtained by calling MetricsStorageConnection().
  *
  * The current implementation will not work if the database is mutated by
  * multiple connections because of the way we cache primary keys.
  *
  * FUTURE enforce 1 read/write connection per database limit.
  */
 function MetricsStorageSqliteBackend(connection) {
-  this._log = Log.repository.getLogger("Services.Metrics.MetricsStorage");
+  this._log = Log4Moz.repository.getLogger("Services.Metrics.MetricsStorage");
 
   this._connection = connection;
   this._enabledWALCheckpointPages = null;
 
   // Integer IDs to string name.
   this._typesByID = new Map();
 
   // String name to integer IDs.
--- a/services/sync/modules-testing/fakeservices.js
+++ b/services/sync/modules-testing/fakeservices.js
@@ -11,17 +11,17 @@ this.EXPORTED_SYMBOLS = [
   "fakeSHA256HMAC",
 ];
 
 const {utils: Cu} = Components;
 
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/util.js");
 
-let btoa = Cu.import("resource://gre/modules/Log.jsm").btoa;
+let btoa = Cu.import("resource://services-common/log4moz.js").btoa;
 
 this.FakeFilesystemService = function FakeFilesystemService(contents) {
   this.fakeContents = contents;
   let self = this;
 
   Utils.jsonSave = function jsonSave(filePath, that, obj, callback) {
     let json = typeof obj == "function" ? obj.call(that) : obj;
     self.fakeContents["weave/" + filePath + ".json"] = JSON.stringify(json);
--- a/services/sync/modules/addonsreconciler.js
+++ b/services/sync/modules/addonsreconciler.js
@@ -14,17 +14,17 @@
  * standalone file so it could be more easily understood, tested, and
  * hopefully ported.
  */
 
 "use strict";
 
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://gre/modules/AddonManager.jsm");
 
 const DEFAULT_STATE_FILE = "addonsreconciler";
 
 this.CHANGE_INSTALLED   = 1;
 this.CHANGE_UNINSTALLED = 2;
 this.CHANGE_ENABLED     = 3;
@@ -108,19 +108,19 @@ this.EXPORTED_SYMBOLS = ["AddonsReconcil
  * add-ons are first disabled then they are actually uninstalled. So, we will
  * see AL.onDisabling and AL.onDisabled. The onUninstalling and onUninstalled
  * events only come after the Addon Manager is closed or another view is
  * switched to. In the case of Sync performing the uninstall, the uninstall
  * events will occur immediately. However, we still see disabling events and
  * heed them like they were normal. In the end, the state is proper.
  */
 this.AddonsReconciler = function AddonsReconciler() {
-  this._log = Log.repository.getLogger("Sync.AddonsReconciler");
+  this._log = Log4Moz.repository.getLogger("Sync.AddonsReconciler");
   let level = Svc.Prefs.get("log.logger.addonsreconciler", "Debug");
-  this._log.level = Log.Level[level];
+  this._log.level = Log4Moz.Level[level];
 
   Svc.Obs.add("xpcom-shutdown", this.stopListening, this);
 };
 AddonsReconciler.prototype = {
   /** Flag indicating whether we are listening to AddonManager events. */
   _listening: false,
 
   /**
@@ -135,17 +135,17 @@ AddonsReconciler.prototype = {
    * to disk when handling events.
    *
    * This allows test code to avoid spinning to write during observer
    * notifications and xpcom shutdown, which appears to cause hangs on WinXP
    * (Bug 873861).
    */
   _shouldPersist: true,
 
-  /** Log logger instance */
+  /** log4moz logger instance */
   _log: null,
 
   /**
    * Container for add-on metadata.
    *
    * Keys are add-on IDs. Values are objects which describe the state of the
    * add-on. This is a minimal mirror of data that can be queried from
    * AddonManager. In some cases, we retain data longer than AddonManager.
--- a/services/sync/modules/addonutils.js
+++ b/services/sync/modules/addonutils.js
@@ -4,27 +4,27 @@
 
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["AddonUtils"];
 
 const {interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/util.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
   "resource://gre/modules/AddonManager.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
   "resource://gre/modules/AddonRepository.jsm");
 
 function AddonUtilsInternal() {
-  this._log = Log.repository.getLogger("Sync.AddonUtils");
-  this._log.Level = Log.Level[Svc.Prefs.get("log.logger.addonutils")];
+  this._log = Log4Moz.repository.getLogger("Sync.AddonUtils");
+  this._log.Level = Log4Moz.Level[Svc.Prefs.get("log.logger.addonutils")];
 }
 AddonUtilsInternal.prototype = {
   /**
    * Obtain an AddonInstall object from an AddonSearchResult instance.
    *
    * The callback will be invoked with the result of the operation. The
    * callback receives 2 arguments, error and result. Error will be falsy
    * on success or some kind of error value otherwise. The result argument
--- a/services/sync/modules/engines.js
+++ b/services/sync/modules/engines.js
@@ -8,17 +8,17 @@ this.EXPORTED_SYMBOLS = [
   "SyncEngine",
   "Tracker",
   "Store"
 ];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/resource.js");
 Cu.import("resource://services-sync/util.js");
 
@@ -37,19 +37,19 @@ this.Tracker = function Tracker(name, en
   if (!engine) {
     throw new Error("Tracker must be associated with an Engine instance.");
   }
 
   name = name || "Unnamed";
   this.name = this.file = name.toLowerCase();
   this.engine = engine;
 
-  this._log = Log.repository.getLogger("Sync.Tracker." + name);
+  this._log = Log4Moz.repository.getLogger("Sync.Tracker." + name);
   let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
-  this._log.level = Log.Level[level];
+  this._log.level = Log4Moz.Level[level];
 
   this._score = 0;
   this._ignored = [];
   this.ignoreAll = false;
   this.changedIDs = {};
   this.loadChangedIDs();
 }
 Tracker.prototype = {
@@ -192,19 +192,19 @@ this.Store = function Store(name, engine
   if (!engine) {
     throw new Error("Store must be associated with an Engine instance.");
   }
 
   name = name || "Unnamed";
   this.name = name.toLowerCase();
   this.engine = engine;
 
-  this._log = Log.repository.getLogger("Sync.Store." + name);
+  this._log = Log4Moz.repository.getLogger("Sync.Store." + name);
   let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
-  this._log.level = Log.Level[level];
+  this._log.level = Log4Moz.Level[level];
 
   XPCOMUtils.defineLazyGetter(this, "_timer", function() {
     return Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
   });
 }
 Store.prototype = {
 
   _sleep: function _sleep(delay) {
@@ -378,18 +378,18 @@ Store.prototype = {
     throw "override wipe in a subclass";
   }
 };
 
 this.EngineManager = function EngineManager(service) {
   this.service = service;
 
   this._engines = {};
-  this._log = Log.repository.getLogger("Sync.EngineManager");
-  this._log.level = Log.Level[Svc.Prefs.get(
+  this._log = Log4Moz.repository.getLogger("Sync.EngineManager");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get(
     "log.logger.service.engines", "Debug")];
 }
 EngineManager.prototype = {
   get: function get(name) {
     // Return an array of engines if we have an array of names
     if (Array.isArray(name)) {
       let engines = [];
       name.forEach(function(name) {
@@ -471,19 +471,19 @@ this.Engine = function Engine(name, serv
     throw new Error("Engine must be associated with a Service instance.");
   }
 
   this.Name = name || "Unnamed";
   this.name = name.toLowerCase();
   this.service = service;
 
   this._notify = Utils.notify("weave:engine:");
-  this._log = Log.repository.getLogger("Sync.Engine." + this.Name);
+  this._log = Log4Moz.repository.getLogger("Sync.Engine." + this.Name);
   let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
-  this._log.level = Log.Level[level];
+  this._log.level = Log4Moz.Level[level];
 
   this._tracker; // initialize tracker to load previously changed IDs
   this._log.debug("Engine initialized");
 }
 Engine.prototype = {
   // _storeObj, and _trackerObj should to be overridden in subclasses
   _storeObj: Store,
   _trackerObj: Tracker,
@@ -1051,17 +1051,17 @@ SyncEngine.prototype = {
    * This function essentially determines whether to apply an incoming record.
    *
    * @param  item
    *         Record from server to be tested for application.
    * @return boolean
    *         Truthy if incoming record should be applied. False if not.
    */
   _reconcile: function _reconcile(item) {
-    if (this._log.level <= Log.Level.Trace) {
+    if (this._log.level <= Log4Moz.Level.Trace) {
       this._log.trace("Incoming: " + item);
     }
 
     // We start reconciling by collecting a bunch of state. We do this here
     // because some state may change during the course of this function and we
     // need to operate on the original values.
     let existsLocally   = this._store.itemExists(item.id);
     let locallyModified = item.id in this._modified;
@@ -1268,17 +1268,17 @@ SyncEngine.prototype = {
         }
 
         up.clearRecords();
       });
 
       for each (let id in modifiedIDs) {
         try {
           let out = this._createRecord(id);
-          if (this._log.level <= Log.Level.Trace)
+          if (this._log.level <= Log4Moz.Level.Trace)
             this._log.trace("Outgoing: " + out);
 
           out.encrypt(this.service.collectionKeys.keyForCollection(this.name));
           up.pushData(out);
         }
         catch(ex) {
           this._log.warn("Error creating record: " + Utils.exceptionStr(ex));
         }
--- a/services/sync/modules/engines/forms.js
+++ b/services/sync/modules/engines/forms.js
@@ -9,34 +9,34 @@ const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-common/async.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://services-sync/constants.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 const FORMS_TTL = 5184000; // 60 days
 
 this.FormRec = function FormRec(collection, id) {
   CryptoWrapper.call(this, collection, id);
 }
 FormRec.prototype = {
   __proto__: CryptoWrapper.prototype,
   _logName: "Sync.Record.Form",
   ttl: FORMS_TTL
 };
 
 Utils.deferGetSet(FormRec, "cleartext", ["name", "value"]);
 
 
 let FormWrapper = {
-  _log: Log.repository.getLogger("Sync.Engine.Forms"),
+  _log: Log4Moz.repository.getLogger("Sync.Engine.Forms"),
 
   _getEntryCols: ["fieldname", "value"],
   _guidCols:     ["guid"],
 
   // Do a "sync" search by spinning the event loop until it completes.
   _searchSpinningly: function(terms, searchData) {
     let results = [];
     let cb = Async.makeSpinningCallback();
--- a/services/sync/modules/engines/history.js
+++ b/services/sync/modules/engines/history.js
@@ -8,17 +8,17 @@ const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 const HISTORY_TTL = 5184000; // 60 days
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/util.js");
 
 this.HistoryRec = function HistoryRec(collection, id) {
   CryptoWrapper.call(this, collection, id);
 }
--- a/services/sync/modules/identity.js
+++ b/services/sync/modules/identity.js
@@ -5,17 +5,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["IdentityManager"];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://services-sync/constants.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/util.js");
 
 // Lazy import to prevent unnecessary load on startup.
 for (let symbol of ["BulkKeyBundle", "SyncKeyBundle"]) {
   XPCOMUtils.defineLazyModuleGetter(this, symbol,
                                     "resource://services-sync/keys.js",
                                     symbol);
 }
@@ -52,18 +52,18 @@ for (let symbol of ["BulkKeyBundle", "Sy
  * functions to support your API. Although, that is certainly not required.
  * If you do monkeypatch, please be advised that Sync expects the core
  * attributes to have values. You will need to carry at least account and
  * username forward. If you do not wish to support one of the built-in
  * authentication mechanisms, you'll probably want to redefine currentAuthState
  * and any other function that involves the built-in functionality.
  */
 this.IdentityManager = function IdentityManager() {
-  this._log = Log.repository.getLogger("Sync.Identity");
-  this._log.Level = Log.Level[Svc.Prefs.get("log.logger.identity")];
+  this._log = Log4Moz.repository.getLogger("Sync.Identity");
+  this._log.Level = Log4Moz.Level[Svc.Prefs.get("log.logger.identity")];
 
   this._basicPassword = null;
   this._basicPasswordAllowLookup = true;
   this._basicPasswordUpdated = false;
   this._syncKey = null;
   this._syncKeyAllowLookup = true;
   this._syncKeySet = false;
   this._syncKeyBundle = null;
--- a/services/sync/modules/jpakeclient.js
+++ b/services/sync/modules/jpakeclient.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["JPAKEClient", "SendCredentialsController"];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/util.js");
 
 const REQUEST_TIMEOUT         = 60; // 1 minute
 const KEYEXCHANGE_VERSION     = 3;
 
 const JPAKE_SIGNERID_SENDER   = "sender";
@@ -109,18 +109,18 @@ const JPAKE_VERIFY_VALUE      = "0123456
  *   client.abort();
  * 
  * Note that after completion or abort, the 'client' instance may not be reused.
  * You will have to create a new one in case you'd like to restart the process.
  */
 this.JPAKEClient = function JPAKEClient(controller) {
   this.controller = controller;
 
-  this._log = Log.repository.getLogger("Sync.JPAKEClient");
-  this._log.level = Log.Level[Svc.Prefs.get(
+  this._log = Log4Moz.repository.getLogger("Sync.JPAKEClient");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get(
     "log.logger.service.jpakeclient", "Debug")];
 
   this._serverURL = Svc.Prefs.get("jpake.serverURL");
   this._pollInterval = Svc.Prefs.get("jpake.pollInterval");
   this._maxTries = Svc.Prefs.get("jpake.maxTries");
   if (this._serverURL.slice(-1) != "/") {
     this._serverURL += "/";
   }
@@ -695,18 +695,18 @@ JPAKEClient.prototype = {
  * Usage:
  *
  *   jpakeclient.controller = new SendCredentialsController(jpakeclient,
  *                                                          service);
  *
  */
 this.SendCredentialsController =
  function SendCredentialsController(jpakeclient, service) {
-  this._log = Log.repository.getLogger("Sync.SendCredentialsController");
-  this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
+  this._log = Log4Moz.repository.getLogger("Sync.SendCredentialsController");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
 
   this._log.trace("Loading.");
   this.jpakeclient = jpakeclient;
   this.service = service;
 
   // Register ourselves as observers the first Sync finishing (either
   // successfully or unsuccessfully, we don't care) or for removing
   // this device's sync configuration, in case that happens while we
--- a/services/sync/modules/keys.js
+++ b/services/sync/modules/keys.js
@@ -7,17 +7,17 @@
 this.EXPORTED_SYMBOLS = [
   "BulkKeyBundle",
   "SyncKeyBundle"
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://services-sync/constants.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/util.js");
 
 /**
  * Represents a pair of keys.
  *
  * Each key stored in a key bundle is 256 bits. One key is used for symmetric
  * encryption. The other is used for HMAC.
  *
@@ -115,17 +115,17 @@ KeyBundle.prototype = {
 };
 
 /**
  * Represents a KeyBundle associated with a collection.
  *
  * This is just a KeyBundle with a collection attached.
  */
 this.BulkKeyBundle = function BulkKeyBundle(collection) {
-  let log = Log.repository.getLogger("Sync.BulkKeyBundle");
+  let log = Log4Moz.repository.getLogger("Sync.BulkKeyBundle");
   log.info("BulkKeyBundle being created for " + collection);
   KeyBundle.call(this);
 
   this._collection = collection;
 }
 
 BulkKeyBundle.prototype = {
   __proto__: KeyBundle.prototype,
@@ -172,17 +172,17 @@ BulkKeyBundle.prototype = {
  *
  * Instances of this type should be considered immutable. You create an
  * instance by specifying the username and 26 character "friendly" Base32
  * encoded Sync Key. The Sync Key is derived at instance creation time.
  *
  * If the username or Sync Key is invalid, an Error will be thrown.
  */
 this.SyncKeyBundle = function SyncKeyBundle(username, syncKey) {
-  let log = Log.repository.getLogger("Sync.SyncKeyBundle");
+  let log = Log4Moz.repository.getLogger("Sync.SyncKeyBundle");
   log.info("SyncKeyBundle being created.");
   KeyBundle.call(this);
 
   this.generateFromKey(username, syncKey);
 }
 SyncKeyBundle.prototype = {
   __proto__: KeyBundle.prototype,
 
--- a/services/sync/modules/notifications.js
+++ b/services/sync/modules/notifications.js
@@ -5,17 +5,17 @@
 this.EXPORTED_SYMBOLS = ["Notifications", "Notification", "NotificationButton"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://services-common/observers.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/util.js");
 
 this.Notifications = {
   // Match the referenced values in toolkit/content/widgets/notification.xml.
   get PRIORITY_INFO()     1, // PRIORITY_INFO_LOW
   get PRIORITY_WARNING()  4, // PRIORITY_WARNING_LOW
   get PRIORITY_ERROR()    7, // PRIORITY_CRITICAL_LOW
 
@@ -110,17 +110,17 @@ Notification.prototype.buttons = [];
  * A button to display in a notification.
  */
 this.NotificationButton =
  function NotificationButton(label, accessKey, callback) {
   function callbackWrapper() {
     try {
       callback.apply(this, arguments);
     } catch (e) {
-      let logger = Log.repository.getLogger("Sync.Notifications");
+      let logger = Log4Moz.repository.getLogger("Sync.Notifications");
       logger.error("An exception occurred: " + Utils.exceptionStr(e));
       logger.info(Utils.stackTrace(e));
       throw e;
     }
   }
 
   this.label = label;
   this.accessKey = accessKey;
--- a/services/sync/modules/policies.js
+++ b/services/sync/modules/policies.js
@@ -4,28 +4,28 @@
 
 this.EXPORTED_SYMBOLS = [
   "ErrorHandler",
   "SyncScheduler",
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/status.js");
 Cu.import("resource://services-sync/util.js");
 
 this.SyncScheduler = function SyncScheduler(service) {
   this.service = service;
   this.init();
 }
 SyncScheduler.prototype = {
-  _log: Log.repository.getLogger("Sync.SyncScheduler"),
+  _log: Log4Moz.repository.getLogger("Sync.SyncScheduler"),
 
   _fatalLoginStatus: [LOGIN_FAILED_NO_USERNAME,
                       LOGIN_FAILED_NO_PASSWORD,
                       LOGIN_FAILED_NO_PASSPHRASE,
                       LOGIN_FAILED_INVALID_PASSPHRASE,
                       LOGIN_FAILED_LOGIN_REJECTED],
 
   /**
@@ -62,17 +62,17 @@ SyncScheduler.prototype = {
 
   get globalScore() Svc.Prefs.get("globalScore", 0),
   set globalScore(value) Svc.Prefs.set("globalScore", value),
 
   get numClients() Svc.Prefs.get("numClients", 0),
   set numClients(value) Svc.Prefs.set("numClients", value),
 
   init: function init() {
-    this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
+    this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
     this.setDefaults();
     Svc.Obs.add("weave:engine:score:updated", this);
     Svc.Obs.add("network:offline-status-changed", this);
     Svc.Obs.add("weave:service:sync:start", this);
     Svc.Obs.add("weave:service:sync:finish", this);
     Svc.Obs.add("weave:engine:sync:finish", this);
     Svc.Obs.add("weave:engine:sync:error", this);
     Svc.Obs.add("weave:service:login:error", this);
@@ -495,34 +495,34 @@ ErrorHandler.prototype = {
     Svc.Obs.add("weave:service:login:error", this);
     Svc.Obs.add("weave:service:sync:error", this);
     Svc.Obs.add("weave:service:sync:finish", this);
 
     this.initLogs();
   },
 
   initLogs: function initLogs() {
-    this._log = Log.repository.getLogger("Sync.ErrorHandler");
-    this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
+    this._log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
+    this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
     this._cleaningUpFileLogs = false;
 
-    let root = Log.repository.getLogger("Sync");
-    root.level = Log.Level[Svc.Prefs.get("log.rootLogger")];
+    let root = Log4Moz.repository.getLogger("Sync");
+    root.level = Log4Moz.Level[Svc.Prefs.get("log.rootLogger")];
 
-    let formatter = new Log.BasicFormatter();
-    let capp = new Log.ConsoleAppender(formatter);
-    capp.level = Log.Level[Svc.Prefs.get("log.appender.console")];
+    let formatter = new Log4Moz.BasicFormatter();
+    let capp = new Log4Moz.ConsoleAppender(formatter);
+    capp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.console")];
     root.addAppender(capp);
 
-    let dapp = new Log.DumpAppender(formatter);
-    dapp.level = Log.Level[Svc.Prefs.get("log.appender.dump")];
+    let dapp = new Log4Moz.DumpAppender(formatter);
+    dapp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.dump")];
     root.addAppender(dapp);
 
-    let fapp = this._logAppender = new Log.StorageStreamAppender(formatter);
-    fapp.level = Log.Level[Svc.Prefs.get("log.appender.file.level")];
+    let fapp = this._logAppender = new Log4Moz.StorageStreamAppender(formatter);
+    fapp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.file.level")];
     root.addAppender(fapp);
   },
 
   observe: function observe(subject, topic, data) {
     this._log.trace("Handling " + topic);
     switch(topic) {
       case "weave:engine:sync:applied":
         if (subject.newFailed) {
--- a/services/sync/modules/record.js
+++ b/services/sync/modules/record.js
@@ -13,17 +13,17 @@ this.EXPORTED_SYMBOLS = [
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 const CRYPTO_COLLECTION = "crypto";
 const KEYS_WBO = "keys";
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/keys.js");
 Cu.import("resource://services-sync/resource.js");
 Cu.import("resource://services-sync/util.js");
 
 this.WBORecord = function WBORecord(collection, id) {
   this.data = {};
   this.payload = {};
@@ -106,17 +106,17 @@ WBORecord.prototype = {
 Utils.deferGetSet(WBORecord, "data", ["id", "modified", "sortindex", "payload"]);
 
 /**
  * An interface and caching layer for records.
  */
 this.RecordManager = function RecordManager(service) {
   this.service = service;
 
-  this._log = Log.repository.getLogger(this._logName);
+  this._log = Log4Moz.repository.getLogger(this._logName);
   this._records = {};
 }
 RecordManager.prototype = {
   _recordType: WBORecord,
   _logName: "Sync.RecordManager",
 
   import: function RecordMgr_import(url) {
     this._log.trace("Importing record: " + (url.spec ? url.spec : url));
@@ -276,17 +276,17 @@ Utils.deferGetSet(CryptoWrapper, "cleart
  * You can update this thing simply by giving it /info/collections. It'll
  * use the last modified time to bring itself up to date.
  */
 this.CollectionKeyManager = function CollectionKeyManager() {
   this.lastModified = 0;
   this._collections = {};
   this._default = null;
 
-  this._log = Log.repository.getLogger("Sync.CollectionKeyManager");
+  this._log = Log4Moz.repository.getLogger("Sync.CollectionKeyManager");
 }
 
 // TODO: persist this locally as an Identity. Bug 610913.
 // Note that the last modified time needs to be preserved.
 CollectionKeyManager.prototype = {
 
   // Return information about old vs new keys:
   // * same: true if two collections are equal
--- a/services/sync/modules/resource.js
+++ b/services/sync/modules/resource.js
@@ -9,17 +9,17 @@ this.EXPORTED_SYMBOLS = [
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/util.js");
 
 const DEFAULT_LOAD_FLAGS =
   // Always validate the cache:
   Ci.nsIRequest.LOAD_BYPASS_CACHE |
@@ -45,19 +45,19 @@ const DEFAULT_LOAD_FLAGS =
  *
  *   function callback(error, result) {...}
  *
  * 'error' will be null on successful requests. Likewise, result will not be
  * passed (=undefined) when an error occurs. Note that this is independent of
  * the status of the HTTP response.
  */
 this.AsyncResource = function AsyncResource(uri) {
-  this._log = Log.repository.getLogger(this._logName);
+  this._log = Log4Moz.repository.getLogger(this._logName);
   this._log.level =
-    Log.Level[Svc.Prefs.get("log.logger.network.resources")];
+    Log4Moz.Level[Svc.Prefs.get("log.logger.network.resources")];
   this.uri = uri;
   this._headers = {};
   this._onComplete = Utils.bind2(this, this._onComplete);
 }
 AsyncResource.prototype = {
   _logName: "Sync.AsyncResource",
 
   // ** {{{ AsyncResource.serverTime }}} **
@@ -260,17 +260,17 @@ AsyncResource.prototype = {
                   channel.URI.spec].join(" ");
       this._log.debug("mesg: " + mesg);
 
       if (mesg.length > 200)
         mesg = mesg.substr(0, 200) + "…";
       this._log.debug(mesg);
 
       // Additionally give the full response body when Trace logging.
-      if (this._log.level <= Log.Level.Trace)
+      if (this._log.level <= Log4Moz.Level.Trace)
         this._log.trace(action + " body: " + data);
 
     } catch(ex) {
       // Got a response, but an exception occurred during processing.
       // This shouldn't occur.
       this._log.warn("Caught unexpected exception " + CommonUtils.exceptionStr(ex) +
                      " in _onComplete.");
       this._log.debug(CommonUtils.stackTrace(ex));
@@ -583,18 +583,18 @@ ChannelListener.prototype = {
  *
  * Optionally pass an array of header names. Each header named
  * in this array will be copied between the channels in the
  * event of a redirect.
  */
 function ChannelNotificationListener(headersToCopy) {
   this._headersToCopy = headersToCopy;
 
-  this._log = Log.repository.getLogger(this._logName);
-  this._log.level = Log.Level[Svc.Prefs.get("log.logger.network.resources")];
+  this._log = Log4Moz.repository.getLogger(this._logName);
+  this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.network.resources")];
 }
 ChannelNotificationListener.prototype = {
   _logName: "Sync.Resource",
 
   getInterface: function(aIID) {
     return this.QueryInterface(aIID);
   },
 
@@ -604,17 +604,17 @@ ChannelNotificationListener.prototype = 
         aIID.equals(Ci.nsISupports) ||
         aIID.equals(Ci.nsIChannelEventSink))
       return this;
 
     throw Cr.NS_ERROR_NO_INTERFACE;
   },
 
   notifyCertProblem: function certProblem(socketInfo, sslStatus, targetHost) {
-    let log = Log.repository.getLogger("Sync.CertListener");
+    let log = Log4Moz.repository.getLogger("Sync.CertListener");
     log.warn("Invalid HTTPS certificate encountered!");
 
     // This suppresses the UI warning only. The request is still cancelled.
     return true;
   },
 
   asyncOnChannelRedirect:
     function asyncOnChannelRedirect(oldChannel, newChannel, flags, callback) {
--- a/services/sync/modules/rest.js
+++ b/services/sync/modules/rest.js
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://services-sync/constants.js");
 
 this.EXPORTED_SYMBOLS = ["SyncStorageRequest"];
 
 const STORAGE_REQUEST_TIMEOUT = 5 * 60; // 5 minutes
 
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -15,17 +15,17 @@ const CLUSTER_BACKOFF = 5 * 60 * 1000; /
 // How long a key to generate from an old passphrase.
 const PBKDF2_KEY_BYTES = 16;
 
 const CRYPTO_COLLECTION = "crypto";
 const KEYS_WBO = "keys";
 
 Cu.import("resource://gre/modules/Preferences.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/clients.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/policies.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/resource.js");
@@ -312,19 +312,19 @@ Sync11Service.prototype = {
     }
 
     this.status = Status;
     this.identity = Status._authManager;
     this.collectionKeys = new CollectionKeyManager();
 
     this.errorHandler = new ErrorHandler(this);
 
-    this._log = Log.repository.getLogger("Sync.Service");
+    this._log = Log4Moz.repository.getLogger("Sync.Service");
     this._log.level =
-      Log.Level[Svc.Prefs.get("log.logger.service.main")];
+      Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
 
     this._log.info("Loading Weave " + WEAVE_VERSION);
 
     this._clusterManager = new ClusterManager(this);
     this.recordManager = new RecordManager(this);
 
     this.enabled = true;
 
--- a/services/sync/modules/stages/cluster.js
+++ b/services/sync/modules/stages/cluster.js
@@ -1,27 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["ClusterManager"];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/policies.js");
 Cu.import("resource://services-sync/util.js");
 
 /**
  * Contains code for managing the Sync cluster we are in.
  */
 this.ClusterManager = function ClusterManager(service) {
-  this._log = Log.repository.getLogger("Sync.Service");
-  this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
+  this._log = Log4Moz.repository.getLogger("Sync.Service");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
 
   this.service = service;
 }
 ClusterManager.prototype = {
   get identity() {
     return this.service.identity;
   },
 
--- a/services/sync/modules/stages/enginesync.js
+++ b/services/sync/modules/stages/enginesync.js
@@ -5,30 +5,30 @@
 /**
  * This file contains code for synchronizing engines.
  */
 
 this.EXPORTED_SYMBOLS = ["EngineSynchronizer"];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/policies.js");
 Cu.import("resource://services-sync/util.js");
 
 /**
  * Perform synchronization of engines.
  *
  * This was originally split out of service.js. The API needs lots of love.
  */
 this.EngineSynchronizer = function EngineSynchronizer(service) {
-  this._log = Log.repository.getLogger("Sync.Synchronizer");
-  this._log.level = Log.Level[Svc.Prefs.get("log.logger.synchronizer")];
+  this._log = Log4Moz.repository.getLogger("Sync.Synchronizer");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.synchronizer")];
 
   this.service = service;
 
   this.onComplete = null;
 }
 
 EngineSynchronizer.prototype = {
   sync: function sync() {
--- a/services/sync/modules/status.js
+++ b/services/sync/modules/status.js
@@ -5,22 +5,22 @@
 this.EXPORTED_SYMBOLS = ["Status"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cr = Components.results;
 const Cu = Components.utils;
 
 Cu.import("resource://services-sync/constants.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://gre/modules/Services.jsm");
 
 this.Status = {
-  _log: Log.repository.getLogger("Sync.Status"),
+  _log: Log4Moz.repository.getLogger("Sync.Status"),
   _authManager: new IdentityManager(),
   ready: false,
 
   get service() {
     return this._service;
   },
 
   set service(code) {
@@ -109,17 +109,17 @@ this.Status = {
     // Logger setup.
     let logPref = PREFS_BRANCH + "log.logger.status";
     let logLevel = "Trace";
     try {
       logLevel = Services.prefs.getCharPref(logPref);
     } catch (ex) {
       // Use default.
     }
-    this._log.level = Log.Level[logLevel];
+    this._log.level = Log4Moz.Level[logLevel];
 
     this._log.info("Resetting Status.");
     this.service = STATUS_OK;
     this._login = LOGIN_SUCCEEDED;
     this._sync = SYNC_SUCCEEDED;
     this._engines = {};
     this.partial = false;
   }
--- a/services/sync/modules/userapi.js
+++ b/services/sync/modules/userapi.js
@@ -5,32 +5,32 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [
   "UserAPI10Client",
 ];
 
 const {utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/util.js");
 
 /**
  * A generic client for the user API 1.0 service.
  *
  * http://docs.services.mozilla.com/reg/apis.html
  *
  * Instances are constructed with the base URI of the service.
  */
 this.UserAPI10Client = function UserAPI10Client(baseURI) {
-  this._log = Log.repository.getLogger("Sync.UserAPI");
-  this._log.level = Log.Level[Svc.Prefs.get("log.logger.userapi")];
+  this._log = Log4Moz.repository.getLogger("Sync.UserAPI");
+  this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.userapi")];
 
   this.baseURI = baseURI;
 }
 UserAPI10Client.prototype = {
   USER_CREATE_ERROR_CODES: {
     2: "Incorrect or missing captcha.",
     4: "User exists.",
     6: "JSON parse failure.",
--- a/services/sync/modules/util.js
+++ b/services/sync/modules/util.js
@@ -2,17 +2,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 this.EXPORTED_SYMBOLS = ["XPCOMUtils", "Services", "NetUtil", "PlacesUtils",
                          "FileUtils", "Utils", "Async", "Svc", "Str"];
 
 const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-common/stringbundle.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-common/async.js", this);
 Cu.import("resource://services-crypto/utils.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://gre/modules/FileUtils.jsm", this);
 Cu.import("resource://gre/modules/NetUtil.jsm", this);
--- a/services/sync/tests/unit/head_http_server.js
+++ b/services/sync/tests/unit/head_http_server.js
@@ -1,12 +1,12 @@
 const Cm = Components.manager;
 
 // Shared logging for all HTTP server functions.
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 const SYNC_HTTP_LOGGER = "Sync.Test.Server";
 const SYNC_API_VERSION = "1.1";
 
 // Use the same method that record.js does, which mirrors the server.
 // The server returns timestamps with 1/100 sec granularity. Note that this is
 // subject to change: see Bug 650435.
 function new_timestamp() {
   return Math.round(Date.now() / 10) / 100;
@@ -158,17 +158,17 @@ function ServerCollection(wbos, acceptNe
   this.acceptNew = acceptNew || false;
 
   /*
    * Track modified timestamp.
    * We can't just use the timestamps of contained WBOs: an empty collection
    * has a modified time.
    */
   this.timestamp = timestamp || new_timestamp();
-  this._log = Log.repository.getLogger(SYNC_HTTP_LOGGER);
+  this._log = Log4Moz.repository.getLogger(SYNC_HTTP_LOGGER);
 }
 ServerCollection.prototype = {
 
   /**
    * Convenience accessor for our WBO keys.
    * Excludes deleted items, of course.
    *
    * @param filter
@@ -522,17 +522,17 @@ let SyncServerCallback = {
  * Construct a new test Sync server. Takes a callback object (e.g.,
  * SyncServerCallback) as input.
  */
 function SyncServer(callback) {
   this.callback = callback || {__proto__: SyncServerCallback};
   this.server   = new HttpServer();
   this.started  = false;
   this.users    = {};
-  this._log     = Log.repository.getLogger(SYNC_HTTP_LOGGER);
+  this._log     = Log4Moz.repository.getLogger(SYNC_HTTP_LOGGER);
 
   // Install our own default handler. This allows us to mess around with the
   // whole URL space.
   let handler = this.server._handler;
   handler._handleDefault = this.handleDefault.bind(this, handler);
 }
 SyncServer.prototype = {
   server: null,    // HttpServer.
--- a/services/sync/tests/unit/test_addons_engine.js
+++ b/services/sync/tests/unit/test_addons_engine.js
@@ -235,23 +235,23 @@ add_test(function test_disabled_install_
 add_test(function cleanup() {
   // There's an xpcom-shutdown hook for this, but let's give this a shot.
   reconciler.stopListening();
   run_next_test();
 });
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Addons").level =
-    Log.Level.Trace;
-  Log.repository.getLogger("Sync.Store.Addons").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Tracker.Addons").level =
-    Log.Level.Trace;
-  Log.repository.getLogger("Sync.AddonsRepository").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Addons").level =
+    Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Store.Addons").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Tracker.Addons").level =
+    Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AddonsRepository").level =
+    Log4Moz.Level.Trace;
 
   reconciler.startListening();
 
   // Don't flush to disk in the middle of an event listener!
   // This causes test hangs on WinXP.
   reconciler._shouldPersist = false;
 
   advance_test();
--- a/services/sync/tests/unit/test_addons_reconciler.js
+++ b/services/sync/tests/unit/test_addons_reconciler.js
@@ -9,19 +9,19 @@ Cu.import("resource://services-sync/engi
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 loadAddonTestFunctions();
 startupManager();
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.AddonsReconciler").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.AddonsReconciler").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AddonsReconciler").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AddonsReconciler").level =
+    Log4Moz.Level.Trace;
 
   Svc.Prefs.set("engine.addons", true);
   Service.engineManager.register(AddonsEngine);
 
   run_next_test();
 }
 
 add_test(function test_defaults() {
--- a/services/sync/tests/unit/test_addons_store.js
+++ b/services/sync/tests/unit/test_addons_store.js
@@ -62,19 +62,19 @@ function createAndStartHTTPServer(port) 
     _("Got exception starting HTTP server on port " + port);
     _("Error: " + Utils.exceptionStr(ex));
     do_throw(ex);
   }
 }
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Addons").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.AddonsRepository").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Addons").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AddonsRepository").level =
+    Log4Moz.Level.Trace;
 
   reconciler.startListening();
 
   // Don't flush to disk in the middle of an event listener!
   // This causes test hangs on WinXP.
   reconciler._shouldPersist = false;
 
   run_next_test();
--- a/services/sync/tests/unit/test_addons_tracker.js
+++ b/services/sync/tests/unit/test_addons_tracker.js
@@ -38,19 +38,19 @@ function cleanup_and_advance() {
   reconciler.saveState(null, cb);
   cb.wait();
 
   run_next_test();
 }
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Addons").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.AddonsReconciler").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Addons").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AddonsReconciler").level =
+    Log4Moz.Level.Trace;
 
   cleanup_and_advance();
 }
 
 add_test(function test_empty() {
   _("Verify the tracker is empty to start with.");
 
   do_check_eq(0, Object.keys(tracker.changedIDs).length);
--- a/services/sync/tests/unit/test_bookmark_engine.js
+++ b/services/sync/tests/unit/test_bookmark_engine.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm");
 Cu.import("resource://services-common/async.js");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/bookmarks.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 Cu.import("resource://gre/modules/Promise.jsm");
 
 Service.engineManager.register(BookmarksEngine);
--- a/services/sync/tests/unit/test_bookmark_legacy_microsummaries_support.js
+++ b/services/sync/tests/unit/test_bookmark_legacy_microsummaries_support.js
@@ -1,17 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 // Tests that Sync can correctly handle a legacy microsummary record
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/bookmarks.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 const GENERATORURI_ANNO = "microsummary/generatorURI";
 const STATICTITLE_ANNO = "bookmarks/staticTitle";
@@ -40,17 +40,17 @@ function run_test() {
   Service.engineManager.register(BookmarksEngine);
   let engine = Service.engineManager.get("bookmarks");
   let store = engine._store;
 
   // Clean up.
   store.wipe();
 
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
 
   _("Create a microsummarized bookmark.");
   let id = newMicrosummary(TEST_URL, TEST_TITLE);
   let guid = store.GUIDForId(id);
   _("GUID: " + guid);
   do_check_true(!!guid);
 
   _("Create record object and verify that it's sane.");
--- a/services/sync/tests/unit/test_bookmark_livemarks.js
+++ b/services/sync/tests/unit/test_bookmark_livemarks.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/bookmarks.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://testing-common/services-common/utils.js");
 
@@ -65,18 +65,18 @@ function makeLivemark(p, mintGUID) {
     b.id = Utils.makeGUID();
 
   return b;
 }
 
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Store.Bookmarks").level  = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level  = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_livemark_descriptions() {
   let record = record631361.payload;
 
   function doRecord(r) {
--- a/services/sync/tests/unit/test_bookmark_places_query_rewriting.js
+++ b/services/sync/tests/unit/test_bookmark_places_query_rewriting.js
@@ -6,18 +6,18 @@ Cu.import("resource://services-sync/engi
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 let engine = new BookmarksEngine(Service);
 let store = engine._store;
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Store.Bookmarks").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level = Log4Moz.Level.Trace;
 
   let tagRecord = new BookmarkQuery("bookmarks", "abcdefabcdef");
   let uri = "place:folder=499&type=7&queryType=1";
   tagRecord.queryId = "MagicTags";
   tagRecord.parentName = "Bookmarks Toolbar";
   tagRecord.bmkUri = uri;
   tagRecord.title = "tagtag";
   tagRecord.folderName = "bar";
--- a/services/sync/tests/unit/test_bookmark_record.js
+++ b/services/sync/tests/unit/test_bookmark_record.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/engines/bookmarks.js");
 Cu.import("resource://services-sync/keys.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 function prepareBookmarkItem(collection, id) {
   let b = new Bookmark(collection, id);
@@ -15,18 +15,18 @@ function prepareBookmarkItem(collection,
 }
 
 function run_test() {
   Service.identity.username = "john@example.com";
   Service.identity.syncKey = "abcdeabcdeabcdeabcdeabcdea";
   generateNewKeys(Service.collectionKeys);
   let keyBundle = Service.identity.syncKeyBundle;
 
-  let log = Log.repository.getLogger("Test");
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let log = Log4Moz.repository.getLogger("Test");
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   log.info("Creating a record");
 
   let u = "http://localhost:8080/storage/bookmarks/foo";
   let placesItem = new PlacesItem("bookmarks", "foo", "bookmark");
   let bookmarkItem = prepareBookmarkItem("bookmarks", "foo");
 
   log.info("Checking getTypeObject");
--- a/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
+++ b/services/sync/tests/unit/test_bookmark_smart_bookmarks.js
@@ -1,13 +1,13 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/bookmarks.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 const SMART_BOOKMARKS_ANNO = "Places/SmartBookmark";
 var IOService = Cc["@mozilla.org/network/io-service;1"]
@@ -222,14 +222,14 @@ add_test(function test_smart_bookmarks_d
     server.stop(do_test_finished);
     Svc.Prefs.resetBranch("");
     Service.recordManager.clearCache();
   }
 });
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
 
   generateNewKeys(Service.collectionKeys);
 
   run_next_test();
 }
--- a/services/sync/tests/unit/test_bookmark_tracker.js
+++ b/services/sync/tests/unit/test_bookmark_tracker.js
@@ -162,17 +162,17 @@ function test_onItemMoved() {
     Svc.Obs.notify("weave:engine:stop-tracking");
   }
 
 }
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Store.Bookmarks").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Tracker.Bookmarks").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Tracker.Bookmarks").level = Log4Moz.Level.Trace;
 
   test_tracking();
   test_onItemChanged();
   test_onItemMoved();
 }
 
--- a/services/sync/tests/unit/test_clients_engine.js
+++ b/services/sync/tests/unit/test_clients_engine.js
@@ -546,11 +546,11 @@ add_test(function test_receive_display_u
 
   Svc.Obs.add(ev, handler);
 
   do_check_true(engine.processIncomingCommands());
 });
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Clients").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Clients").level = Log4Moz.Level.Trace;
   run_next_test();
 }
--- a/services/sync/tests/unit/test_corrupt_keys.js
+++ b/services/sync/tests/unit/test_corrupt_keys.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/engines/tabs.js");
 Cu.import("resource://services-sync/engines/history.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/status.js");
 Cu.import("resource://services-sync/util.js");
@@ -198,18 +198,18 @@ add_task(function test_locally_changed_k
     Svc.Prefs.resetBranch("");
     let deferred = Promise.defer();
     server.stop(deferred.resolve);
     yield deferred.promise;
   }
 });
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   run_next_test();
 }
 
 /**
  * Asynchronously check a url is visited.
  * @param url the url
  * @return {Promise}
--- a/services/sync/tests/unit/test_errorhandler.js
+++ b/services/sync/tests/unit/test_errorhandler.js
@@ -46,19 +46,19 @@ engineManager.register(CatapultEngine);
 
 // This relies on Service/ErrorHandler being a singleton. Fixing this will take
 // a lot of work.
 let errorHandler = Service.errorHandler;
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 function generateCredentialsChangedFailure() {
   // Make sync fail due to changed credentials. We simply re-encrypt
   // the keys with a different Sync Key, without changing the local one.
   let newSyncKeyBundle = new SyncKeyBundle("johndoe", "23456234562345623456234562");
@@ -1578,17 +1578,17 @@ add_test(function test_sync_engine_gener
   let server = sync_httpd_setup();
 
   let engine = engineManager.get("catapult");
   engine.enabled = true;
   engine.sync = function sync() {
     Svc.Obs.notify("weave:engine:sync:error", "", "catapult");
   };
 
-  let log = Log.repository.getLogger("Sync.ErrorHandler");
+  let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
   Svc.Prefs.set("log.appender.file.logOnError", true);
 
   do_check_eq(Status.engines["catapult"], undefined);
 
   // Don't wait for reset-file-log until the sync is underway.
   // This avoids us catching a delayed notification from an earlier test.
   Svc.Obs.add("weave:engine:sync:finish", function onEngineFinish() {
     Svc.Obs.remove("weave:engine:sync:finish", onEngineFinish);
@@ -1618,17 +1618,17 @@ add_test(function test_sync_engine_gener
   do_check_true(setUp(server));
   Service.sync();
 });
 
 add_test(function test_logs_on_sync_error_despite_shouldReportError() {
   _("Ensure that an error is still logged when weave:service:sync:error " +
     "is notified, despite shouldReportError returning false.");
 
-  let log = Log.repository.getLogger("Sync.ErrorHandler");
+  let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
   Svc.Prefs.set("log.appender.file.logOnError", true);
   log.info("TESTING");
 
   // Ensure that we report no error.
   Status.login = MASTER_PASSWORD_LOCKED;
   do_check_false(errorHandler.shouldReportError());
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
@@ -1646,17 +1646,17 @@ add_test(function test_logs_on_sync_erro
   });
   Svc.Obs.notify("weave:service:sync:error", {});
 });
 
 add_test(function test_logs_on_login_error_despite_shouldReportError() {
   _("Ensure that an error is still logged when weave:service:login:error " +
     "is notified, despite shouldReportError returning false.");
 
-  let log = Log.repository.getLogger("Sync.ErrorHandler");
+  let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
   Svc.Prefs.set("log.appender.file.logOnError", true);
   log.info("TESTING");
 
   // Ensure that we report no error.
   Status.login = MASTER_PASSWORD_LOCKED;
   do_check_false(errorHandler.shouldReportError());
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
@@ -1682,17 +1682,17 @@ add_test(function test_engine_applyFaile
 
   let engine = engineManager.get("catapult");
   engine.enabled = true;
   delete engine.exception;
   engine.sync = function sync() {
     Svc.Obs.notify("weave:engine:sync:applied", {newFailed:1}, "catapult");
   };
 
-  let log = Log.repository.getLogger("Sync.ErrorHandler");
+  let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
   Svc.Prefs.set("log.appender.file.logOnError", true);
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
 
     do_check_eq(Status.engines["catapult"], ENGINE_APPLY_FAIL);
     do_check_eq(Status.service, SYNC_FAILED_PARTIAL);
 
--- a/services/sync/tests/unit/test_errorhandler_filelog.js
+++ b/services/sync/tests/unit/test_errorhandler_filelog.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/utils.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 const logsdir            = FileUtils.getDir("ProfD", ["weave", "logs"], true);
 const LOG_PREFIX_SUCCESS = "success-";
 const LOG_PREFIX_ERROR   = "error-";
 
@@ -24,50 +24,50 @@ let errorHandler = Service.errorHandler;
 
 function setLastSync(lastSyncValue) {
   Svc.Prefs.set("lastSync", (new Date(Date.now() - lastSyncValue)).toString());
 }
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_noOutput() {
   // Ensure that the log appender won't print anything.
-  errorHandler._logAppender.level = Log.Level.Fatal + 1;
+  errorHandler._logAppender.level = Log4Moz.Level.Fatal + 1;
 
   // Clear log output from startup.
   Svc.Prefs.set("log.appender.file.logOnSuccess", false);
   Svc.Obs.notify("weave:service:sync:finish");
 
   // Clear again without having issued any output.
   Svc.Prefs.set("log.appender.file.logOnSuccess", true);
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
 
-    errorHandler._logAppender.level = Log.Level.Trace;
+    errorHandler._logAppender.level = Log4Moz.Level.Trace;
     Svc.Prefs.resetBranch("");
     run_next_test();
   });
 
   // Fake a successful sync.
   Svc.Obs.notify("weave:service:sync:finish");
 });
 
 add_test(function test_logOnSuccess_false() {
   Svc.Prefs.set("log.appender.file.logOnSuccess", false);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   log.info("this won't show up");
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
     // No log file was written.
     do_check_false(logsdir.directoryEntries.hasMoreElements());
 
     Svc.Prefs.resetBranch("");
@@ -84,17 +84,17 @@ function readFile(file, callback) {
                                                inputStream.available());
     callback(statusCode, data);
   });
 }
 
 add_test(function test_logOnSuccess_true() {
   Svc.Prefs.set("log.appender.file.logOnSuccess", true);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   const MESSAGE = "this WILL show up";
   log.info(MESSAGE);
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
 
     // Exactly one log file was written.
     let entries = logsdir.directoryEntries;
@@ -125,17 +125,17 @@ add_test(function test_logOnSuccess_true
 
   // Fake a successful sync.
   Svc.Obs.notify("weave:service:sync:finish");
 });
 
 add_test(function test_sync_error_logOnError_false() {
   Svc.Prefs.set("log.appender.file.logOnError", false);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   log.info("this won't show up");
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
     // No log file was written.
     do_check_false(logsdir.directoryEntries.hasMoreElements());
 
     Svc.Prefs.resetBranch("");
@@ -145,17 +145,17 @@ add_test(function test_sync_error_logOnE
   // Fake an unsuccessful sync due to prolonged failure.
   setLastSync(PROLONGED_ERROR_DURATION);
   Svc.Obs.notify("weave:service:sync:error");
 });
 
 add_test(function test_sync_error_logOnError_true() {
   Svc.Prefs.set("log.appender.file.logOnError", true);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   const MESSAGE = "this WILL show up";
   log.info(MESSAGE);
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
 
     // Exactly one log file was written.
     let entries = logsdir.directoryEntries;
@@ -187,17 +187,17 @@ add_test(function test_sync_error_logOnE
   // Fake an unsuccessful sync due to prolonged failure.
   setLastSync(PROLONGED_ERROR_DURATION);
   Svc.Obs.notify("weave:service:sync:error");
 });
 
 add_test(function test_login_error_logOnError_false() {
   Svc.Prefs.set("log.appender.file.logOnError", false);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   log.info("this won't show up");
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
     // No log file was written.
     do_check_false(logsdir.directoryEntries.hasMoreElements());
 
     Svc.Prefs.resetBranch("");
@@ -207,17 +207,17 @@ add_test(function test_login_error_logOn
   // Fake an unsuccessful login due to prolonged failure.
   setLastSync(PROLONGED_ERROR_DURATION);
   Svc.Obs.notify("weave:service:login:error");
 });
 
 add_test(function test_login_error_logOnError_true() {
   Svc.Prefs.set("log.appender.file.logOnError", true);
 
-  let log = Log.repository.getLogger("Sync.Test.FileLog");
+  let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
   const MESSAGE = "this WILL show up";
   log.info(MESSAGE);
 
   Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
     Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
 
     // Exactly one log file was written.
     let entries = logsdir.directoryEntries;
--- a/services/sync/tests/unit/test_forms_tracker.js
+++ b/services/sync/tests/unit/test_forms_tracker.js
@@ -1,25 +1,25 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/engines/forms.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 function run_test() {
   _("Verify we've got an empty tracker to work with.");
   let engine = new FormEngine(Service);
   let tracker = engine._tracker;
   // Don't do asynchronous writes.
   tracker.persistChangedIDs = false;
 
   do_check_empty(tracker.changedIDs);
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   function addEntry(name, value) {
     engine._store.create({name: name, value: value});
   }
   function removeEntry(name, value) {
     guid = engine._findDupe({name: name, value: value});
     engine._store.remove({id: guid});
   }
--- a/services/sync/tests/unit/test_history_tracker.js
+++ b/services/sync/tests/unit/test_history_tracker.js
@@ -59,17 +59,17 @@ function addVisit() {
 
   // Spin the event loop to embed this async call in a sync API.
   cb.wait();
   return uri;
 }
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Tracker.History").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Tracker.History").level = Log4Moz.Level.Trace;
   run_next_test();
 }
 
 add_test(function test_empty() {
   _("Verify we've got an empty, disabled tracker to work with.");
   do_check_empty(tracker.changedIDs);
   do_check_eq(tracker.score, 0);
   do_check_false(tracker._enabled);
--- a/services/sync/tests/unit/test_httpd_sync_server.js
+++ b/services/sync/tests/unit/test_httpd_sync_server.js
@@ -1,15 +1,15 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://services-sync/util.js");
 
 function run_test() {
-  Log.repository.getLogger("Sync.Test.Server").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Test.Server").level = Log4Moz.Level.Trace;
   initTestLogging();
   run_next_test();
 }
 
 add_test(function test_creation() {
   // Explicit callback for this one.
   let server = new SyncServer({
     __proto__: SyncServerCallback,
--- a/services/sync/tests/unit/test_identity_manager.js
+++ b/services/sync/tests/unit/test_identity_manager.js
@@ -4,17 +4,17 @@
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/util.js");
 
 let identity = new IdentityManager();
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Identity").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Identity").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_username_from_account() {
   _("Ensure usernameFromAccount works properly.");
 
   do_check_eq(identity.usernameFromAccount(null), null);
--- a/services/sync/tests/unit/test_interval_triggers.js
+++ b/services/sync/tests/unit/test_interval_triggers.js
@@ -44,18 +44,18 @@ function setUp(server) {
   let serverKeys = Service.collectionKeys.asWBO("crypto", "keys");
   serverKeys.encrypt(Service.identity.syncKeyBundle);
   return serverKeys.upload(Service.resource(Service.cryptoKeysURL));
 }
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_successful_sync_adjustSyncInterval() {
   _("Test successful sync calling adjustSyncInterval");
   let syncSuccesses = 0;
   function onSyncFinish() {
--- a/services/sync/tests/unit/test_jpakeclient.js
+++ b/services/sync/tests/unit/test_jpakeclient.js
@@ -1,9 +1,9 @@
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/jpakeclient.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 const JPAKE_LENGTH_SECRET     = 8;
 const JPAKE_LENGTH_CLIENTID   = 256;
@@ -184,19 +184,19 @@ function run_test() {
   // Ensure PSM is initialized.
   Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
 
   // Simulate Sync setup with credentials in place. We want to make
   // sure the J-PAKE requests don't include those data.
   setBasicCredentials("johndoe", "ilovejane");
 
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.JPAKEClient").level = Log.Level.Trace;
-  Log.repository.getLogger("Common.RESTRequest").level =
-    Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.JPAKEClient").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Common.RESTRequest").level =
+    Log4Moz.Level.Trace;
   run_next_test();
 }
 
 
 add_test(function test_success_receiveNoPIN() {
   _("Test a successful exchange started by receiveNoPIN().");
 
   let snd = new JPAKEClient({
--- a/services/sync/tests/unit/test_keys.js
+++ b/services/sync/tests/unit/test_keys.js
@@ -167,18 +167,18 @@ add_test(function test_keymanager() {
   let obj = new SyncKeyBundle(username, testKey);
   do_check_eq(hmacKey, obj.hmacKey);
   do_check_eq(encryptKey, obj.encryptionKey);
 
   run_next_test();
 });
 
 add_test(function test_collections_manager() {
-  let log = Log.repository.getLogger("Test");
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let log = Log4Moz.repository.getLogger("Test");
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   let identity = new IdentityManager();
 
   identity.account = "john@example.com";
   identity.syncKey = "a-bbbbb-ccccc-ddddd-eeeee-fffff";
 
   let keyBundle = identity.syncKeyBundle;
 
--- a/services/sync/tests/unit/test_node_reassignment.js
+++ b/services/sync/tests/unit/test_node_reassignment.js
@@ -1,32 +1,32 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 _("Test that node reassignment responses are respected on all kinds of " +
   "requests.");
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/rest.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/status.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/rotaryengine.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 Service.engineManager.clear();
 
 function run_test() {
-  Log.repository.getLogger("Sync.AsyncResource").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.ErrorHandler").level  = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Resource").level      = Log.Level.Trace;
-  Log.repository.getLogger("Sync.RESTRequest").level   = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Service").level       = Log.Level.Trace;
-  Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AsyncResource").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.ErrorHandler").level  = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Resource").level      = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.RESTRequest").level   = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level       = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
   initTestLogging();
 
   Service.engineManager.register(RotaryEngine);
 
   // None of the failures in this file should result in a UI error.
   function onUIError() {
     do_throw("Errors should not be presented in the UI.");
   }
--- a/services/sync/tests/unit/test_password_store.js
+++ b/services/sync/tests/unit/test_password_store.js
@@ -2,18 +2,18 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 Cu.import("resource://services-sync/engines/passwords.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Engine.Passwords").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Store.Passwords").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Engine.Passwords").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Store.Passwords").level = Log4Moz.Level.Trace;
 
   const BOGUS_GUID_A = "zzzzzzzzzzzz";
   const BOGUS_GUID_B = "yyyyyyyyyyyy";
   let recordA = {id: BOGUS_GUID_A,
                   hostname: "http://foo.bar.com",
                   formSubmitURL: "http://foo.bar.com/baz",
                   httpRealm: "secure",
                   username: "john",
--- a/services/sync/tests/unit/test_records_crypto.js
+++ b/services/sync/tests/unit/test_records_crypto.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/keys.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/resource.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 
 let cryptoWrap;
@@ -30,18 +30,18 @@ function run_test() {
   let server;
   do_test_pending();
 
   Service.identity.username = "john@example.com";
   Service.identity.syncKey = "a-abcde-abcde-abcde-abcde-abcde";
   let keyBundle = Service.identity.syncKeyBundle;
 
   try {
-    let log = Log.repository.getLogger("Test");
-    Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+    let log = Log4Moz.repository.getLogger("Test");
+    Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
     log.info("Setting up server and authenticator");
 
     server = httpd_setup({"/steam/resource": crypted_resource_handler});
 
     log.info("Creating a record");
 
     let cryptoUri = "http://localhost:8080/crypto/steam";
--- a/services/sync/tests/unit/test_resource.js
+++ b/services/sync/tests/unit/test_resource.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/resource.js");
 Cu.import("resource://services-sync/util.js");
 
 let logger;
 
 let fetched = false;
@@ -148,18 +148,18 @@ function server_headers(metadata, respon
   response.bodyOutputStream.write(body, body.length);
 }
 
 function run_test() {
   initTestLogging("Trace");
 
   do_test_pending();
 
-  logger = Log.repository.getLogger('Test');
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  logger = Log4Moz.repository.getLogger('Test');
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   let server = httpd_setup({
     "/open": server_open,
     "/protected": server_protected,
     "/404": server_404,
     "/upload": server_upload,
     "/delete": server_delete,
     "/json": server_json,
--- a/services/sync/tests/unit/test_resource_async.js
+++ b/services/sync/tests/unit/test_resource_async.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-common/observers.js");
 Cu.import("resource://services-sync/identity.js");
 Cu.import("resource://services-sync/resource.js");
 Cu.import("resource://services-sync/util.js");
 
 let logger;
 
 let fetched = false;
@@ -148,18 +148,18 @@ function server_headers(metadata, respon
   response.bodyOutputStream.write(body, body.length);
 }
 
 let quotaValue;
 Observers.add("weave:service:quota:remaining",
               function (subject) { quotaValue = subject; });
 
 function run_test() {
-  logger = Log.repository.getLogger('Test');
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  logger = Log4Moz.repository.getLogger('Test');
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   Svc.Prefs.set("network.numRetries", 1); // speed up test
   run_next_test();
 }
 
 // This apparently has to come first in order for our PAC URL to be hit.
 // Don't put any other HTTP requests earlier in the file!
 add_test(function test_proxy_auth_redirect() {
--- a/services/sync/tests/unit/test_resource_ua.js
+++ b/services/sync/tests/unit/test_resource_ua.js
@@ -19,17 +19,17 @@ let ua;
 function uaHandler(f) {
   return function(request, response) {
     ua = request.getHeader("User-Agent");
     return f(request, response);
   };
 }
 
 function run_test() {
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
   meta_global = new ServerWBO('global');
   server = httpd_setup({
     "/1.1/johndoe/info/collections": uaHandler(collectionsHelper.handler),
     "/1.1/johndoe/storage/meta/global": uaHandler(meta_global.handler()),
   });
 
   setBasicCredentials("johndoe", "ilovejane");
   Service.serverURL = server.baseURI + "/";
--- a/services/sync/tests/unit/test_score_triggers.js
+++ b/services/sync/tests/unit/test_score_triggers.js
@@ -45,17 +45,17 @@ function sync_httpd_setup() {
 
 function setUp(server) {
   new SyncTestingInfrastructure(server, "johndoe", "ilovejane", "sekrit");
 }
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_tracker_score_updated() {
   let scoreUpdated = 0;
 
   function onScoreUpdated() {
--- a/services/sync/tests/unit/test_sendcredentials_controller.js
+++ b/services/sync/tests/unit/test_sendcredentials_controller.js
@@ -7,18 +7,18 @@ Cu.import("resource://services-sync/serv
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function run_test() {
   setBasicCredentials("johndoe", "ilovejane", Utils.generatePassphrase());
   Service.serverURL  = "http://weave.server/";
 
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.SendCredentialsController").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SendCredentialsController").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
   run_next_test();
 }
 
 function make_sendCredentials_test(topic) {
   return function test_sendCredentials() {
     _("Test sending credentials on " + topic + " observer notification.");
 
     let sendAndCompleteCalled = false;
--- a/services/sync/tests/unit/test_service_changePassword.js
+++ b/services/sync/tests/unit/test_service_changePassword.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.AsyncResource").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Resource").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.AsyncResource").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Resource").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_change_password() {
   let requestBody;
   let server;
 
--- a/services/sync/tests/unit/test_service_detect_upgrade.js
+++ b/services/sync/tests/unit/test_service_detect_upgrade.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/keys.js");
 Cu.import("resource://services-sync/engines/tabs.js");
 Cu.import("resource://services-sync/engines.js");
 Cu.import("resource://services-sync/record.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
@@ -287,13 +287,13 @@ add_test(function v5_upgrade() {
 
   } finally {
     Svc.Prefs.resetBranch("");
     server.stop(run_next_test);
   }
 });
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   run_next_test();
 }
--- a/services/sync/tests/unit/test_service_getStorageInfo.js
+++ b/services/sync/tests/unit/test_service_getStorageInfo.js
@@ -7,18 +7,18 @@ Cu.import("resource://services-sync/serv
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 let collections = {steam:  65.11328,
                    petrol: 82.488281,
                    diesel: 2.25488281};
 
 function run_test() {
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.StorageRequest").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.StorageRequest").level = Log4Moz.Level.Trace;
   initTestLogging();
 
   setBasicCredentials("johndoe", "ilovejane");
 
   run_next_test();
 }
 
 add_test(function test_success() {
--- a/services/sync/tests/unit/test_service_login.js
+++ b/services/sync/tests/unit/test_service_login.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/policies.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function login_handling(handler) {
   return function (request, response) {
@@ -18,18 +18,18 @@ function login_handling(handler) {
       response.setStatusLine(request.httpVersion, 401, "Unauthorized");
       response.setHeader("Content-Type", "text/plain");
       response.bodyOutputStream.write(body, body.length);
     }
   };
 }
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   run_next_test();
 }
 
 add_test(function test_offline() {
   try {
     _("The right bits are set when we're offline.");
     Services.io.offline = true;
--- a/services/sync/tests/unit/test_service_sync_401.js
+++ b/services/sync/tests/unit/test_service_sync_401.js
@@ -15,18 +15,18 @@ function login_handling(handler) {
       let body = "Unauthorized";
       response.setStatusLine(request.httpVersion, 401, "Unauthorized");
       response.bodyOutputStream.write(body, body.length);
     }
   };
 }
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   let collectionsHelper = track_collections_helper();
   let upd = collectionsHelper.with_updated_collection;
   let collections = collectionsHelper.collections;
 
   do_test_pending();
   let server = httpd_setup({
     "/1.1/johndoe/storage/crypto/keys": upd("crypto", new ServerWBO("keys").handler()),
--- a/services/sync/tests/unit/test_service_sync_locked.js
+++ b/services/sync/tests/unit/test_service_sync_locked.js
@@ -11,17 +11,17 @@ function run_test() {
   function augmentLogger(old) {
     let d = old.debug;
     let i = old.info;
     old.debug = function(m) { debug.push(m); d.call(old, m); }
     old.info  = function(m) { info.push(m);  i.call(old, m); }
     return old;
   }
 
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   augmentLogger(Service._log);
 
   // Avoid daily ping
   Svc.Prefs.set("lastPing", Math.floor(Date.now() / 1000));
 
   _("Check that sync will log appropriately if already in 'progress'.");
   Service._locked = true;
--- a/services/sync/tests/unit/test_service_sync_remoteSetup.js
+++ b/services/sync/tests/unit/test_service_sync_remoteSetup.js
@@ -1,22 +1,22 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/keys.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/fakeservices.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   let guidSvc = new FakeGUIDService();
   let clients = new ServerCollection();
   let meta_global = new ServerWBO('global');
 
   let collectionsHelper = track_collections_helper();
   let upd = collectionsHelper.with_updated_collection;
   let collections = collectionsHelper.collections;
--- a/services/sync/tests/unit/test_service_sync_updateEnabledEngines.js
+++ b/services/sync/tests/unit/test_service_sync_updateEnabledEngines.js
@@ -77,18 +77,18 @@ function setUp(server) {
   return serverKeys.upload(Service.resource(Service.cryptoKeysURL)).success;
 }
 
 const PAYLOAD = 42;
 
 
 function run_test() {
   initTestLogging("Trace");
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_newAccount() {
   _("Test: New account does not disable locally enabled engines.");
   let engine = Service.engineManager.get("steam");
   let server = sync_httpd_setup({
--- a/services/sync/tests/unit/test_service_verifyLogin.js
+++ b/services/sync/tests/unit/test_service_verifyLogin.js
@@ -1,12 +1,12 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function login_handling(handler) {
   return function (request, response) {
     if (basic_auth_matches(request, "johndoe", "ilovejane")) {
@@ -22,18 +22,18 @@ function login_handling(handler) {
 function service_unavailable(request, response) {
   let body = "Service Unavailable";
   response.setStatusLine(request.httpVersion, 503, "Service Unavailable");
   response.setHeader("Retry-After", "42");
   response.bodyOutputStream.write(body, body.length);
 }
 
 function run_test() {
-  let logger = Log.repository.rootLogger;
-  Log.repository.rootLogger.addAppender(new Log.DumpAppender());
+  let logger = Log4Moz.repository.rootLogger;
+  Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
 
   // This test expects a clean slate -- no saved passphrase.
   Services.logins.removeAllLogins();
   let johnHelper = track_collections_helper();
   let johnU      = johnHelper.with_updated_collection;
   let johnColls  = johnHelper.collections;
 
   do_test_pending();
--- a/services/sync/tests/unit/test_syncscheduler.js
+++ b/services/sync/tests/unit/test_syncscheduler.js
@@ -71,18 +71,18 @@ function cleanUpAndGo(server) {
       run_next_test();
     }
   });
 }
 
 function run_test() {
   initTestLogging("Trace");
 
-  Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
-  Log.repository.getLogger("Sync.scheduler").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.scheduler").level = Log4Moz.Level.Trace;
 
   run_next_test();
 }
 
 add_test(function test_prefAttributes() {
   _("Test various attributes corresponding to preferences.");
 
   const INTERVAL = 42 * 60 * 1000;   // 42 minutes
--- a/services/sync/tests/unit/test_syncstoragerequest.js
+++ b/services/sync/tests/unit/test_syncstoragerequest.js
@@ -1,20 +1,20 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 Cu.import("resource://services-sync/constants.js");
 Cu.import("resource://services-sync/rest.js");
 Cu.import("resource://services-sync/service.js");
 Cu.import("resource://services-sync/util.js");
 Cu.import("resource://testing-common/services/sync/utils.js");
 
 function run_test() {
-  Log.repository.getLogger("Sync.RESTRequest").level = Log.Level.Trace;
+  Log4Moz.repository.getLogger("Sync.RESTRequest").level = Log4Moz.Level.Trace;
   initTestLogging();
 
   run_next_test();
 }
 
 add_test(function test_user_agent_desktop() {
   let handler = httpd_handler(200, "OK");
   let server = httpd_setup({"/resource": handler});
--- a/testing/marionette/components/marionettecomponent.js
+++ b/testing/marionette/components/marionettecomponent.js
@@ -14,41 +14,41 @@ const MARIONETTE_FORCELOCAL_PREF = 'mari
 
 this.ServerSocket = CC("@mozilla.org/network/server-socket;1",
                        "nsIServerSocket",
                        "initSpecialConnection");
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://gre/modules/services-common/log4moz.js");
 
 let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
                .getService(Ci.mozIJSSubScriptLoader);
 
 function MarionetteComponent() {
   this._loaded = false;
   this.observerService = Services.obs;
 
   // set up the logger
-  this.logger = Log.repository.getLogger("Marionette");
-  this.logger.level = Log.Level["Trace"];
+  this.logger = Log4Moz.repository.getLogger("Marionette");
+  this.logger.level = Log4Moz.Level["Trace"];
   let logf = FileUtils.getFile('ProfD', ['marionette.log']);
 
   let dumper = false;
-  let formatter = new Log.BasicFormatter();
-  this.logger.addAppender(new Log.BoundedFileAppender(logf.path, formatter));
+  let formatter = new Log4Moz.BasicFormatter();
+  this.logger.addAppender(new Log4Moz.BoundedFileAppender(logf.path, formatter));
 #ifdef DEBUG
   dumper = true;
 #endif
 #ifdef MOZ_B2G
   dumper = true;
 #endif
   if (dumper) {
-    this.logger.addAppender(new Log.DumpAppender(formatter));
+    this.logger.addAppender(new Log4Moz.DumpAppender(formatter));
   }
   this.logger.info("MarionetteComponent loaded");
 }
 
 MarionetteComponent.prototype = {
   classDescription: "Marionette component",
   classID: MARIONETTE_CID,
   contractID: MARIONETTE_CONTRACTID,
--- a/testing/marionette/marionette-frame-manager.js
+++ b/testing/marionette/marionette-frame-manager.js
@@ -5,18 +5,18 @@
 this.EXPORTED_SYMBOLS = [
   "FrameManager"
 ];
 
 let FRAME_SCRIPT = "chrome://marionette/content/marionette-listener.js";
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-Cu.import("resource://gre/modules/services-common/Log.js");
-let logger = Log.repository.getLogger("Marionette");
+Cu.import("resource://gre/modules/services-common/log4moz.js");
+let logger = Log4Moz.repository.getLogger("Marionette");
 
 //list of OOP frames that has the frame script loaded
 let remoteFrames = [];
 
 /**
  * An object representing a frame that Marionette has loaded a
  * frame script in.
  */
--- a/testing/marionette/marionette-listener.js
+++ b/testing/marionette/marionette-listener.js
@@ -67,18 +67,18 @@ let nextTouchId = 1000;
 let touchIds = {};
 // last touch for each fingerId
 let multiLast = {};
 let lastCoordinates = null;
 let isTap = false;
 // whether to send mouse event
 let mouseEventsOnly = false;
 
-Cu.import("resource://gre/modules/Log.jsm");
-let logger = Log.repository.getLogger("Marionette");
+Cu.import("resource://gre/modules/services-common/log4moz.js");
+let logger = Log4Moz.repository.getLogger("Marionette");
 logger.info("loaded marionette-listener.js");
 let modalHandler = function() {
   sendSyncMessage("Marionette:switchedToFrame", { frameValue: null, storePrevious: true });
   let isLocal = sendSyncMessage("MarionetteFrame:handleModal", {})[0].value;
   if (isLocal) {
     previousFrame = curFrame;
   }
   curFrame = content;
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -2,18 +2,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const FRAME_SCRIPT = "chrome://marionette/content/marionette-listener.js";
 
 // import logger
-Cu.import("resource://gre/modules/Log.jsm");
-let logger = Log.repository.getLogger("Marionette");
+Cu.import("resource://gre/modules/services-common/log4moz.js");
+let logger = Log4Moz.repository.getLogger("Marionette");
 logger.info('marionette-server.js loaded');
 
 let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
                .getService(Ci.mozIJSSubScriptLoader);
 loader.loadSubScript("chrome://marionette/content/marionette-simpletest.js");
 loader.loadSubScript("chrome://marionette/content/marionette-common.js");
 Cu.import("resource://gre/modules/Services.jsm");
 loader.loadSubScript("chrome://marionette/content/marionette-frame-manager.js");
--- a/toolkit/modules/Http.jsm
+++ b/toolkit/modules/Http.jsm
@@ -19,17 +19,17 @@ function percentEncode(aString)
  *    a string: send it as is
  *    an array of parameters: encode as form values
  *    null/undefined: no POST data.
  *  method, GET, POST or PUT (this is set automatically if postData exists).
  *  onLoad, a function handle to call when the load is complete, it takes two
  *          parameters: the responseText and the XHR object.
  *  onError, a function handle to call when an error occcurs, it takes three
  *          parameters: the error, the responseText and the XHR object.
- *  logger, an object that implements the debug and log methods (e.g. log.jsm).
+ *  logger, an object that implements the debug and log methods (e.g. log4moz).
  *
  * Headers or post data are given as an array of arrays, for each each inner
  * array the first value is the key and the second is the value, e.g.
  *  [["key1", "value1"], ["key2", "value2"]].
  */
 function httpRequest(aUrl, aOptions) {
   let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
               .createInstance(Ci.nsIXMLHttpRequest);
--- a/toolkit/modules/Sqlite.jsm
+++ b/toolkit/modules/Sqlite.jsm
@@ -9,17 +9,17 @@ this.EXPORTED_SYMBOLS = [
 ];
 
 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
 Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
 Cu.import("resource://gre/modules/osfile.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
+Cu.import("resource://services-common/log4moz.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
                                   "resource://gre/modules/AsyncShutdown.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "CommonUtils",
                                   "resource://services-common/utils.js");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
                                   "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "Task",
@@ -61,17 +61,17 @@ let connectionCounters = new Map();
  *   SYNCHRONOUS = full
  *
  * @param options
  *        (Object) Parameters to control connection and open options.
  *
  * @return Promise<OpenedConnection>
  */
 function openConnection(options) {
-  let log = Log.repository.getLogger("Sqlite.ConnectionOpener");
+  let log = Log4Moz.repository.getLogger("Sqlite.ConnectionOpener");
 
   if (!options.path) {
     throw new Error("path not specified in connection options.");
   }
 
   // Retains absolute paths and normalizes relative as relative to profile.
   let path = OS.Path.join(OS.Constants.Path.profileDir, options.path);
 
@@ -168,27 +168,27 @@ function openConnection(options) {
  *        (string) The basename of this database name. Used for logging.
  * @param number
  *        (Number) The connection number to this database.
  * @param options
  *        (object) Options to control behavior of connection. See
  *        `openConnection`.
  */
 function OpenedConnection(connection, basename, number, options) {
-  let log = Log.repository.getLogger("Sqlite.Connection." + basename);
+  let log = Log4Moz.repository.getLogger("Sqlite.Connection." + basename);
 
   // getLogger() returns a shared object. We can't modify the functions on this
   // object since they would have effect on all instances and last write would
   // win. So, we create a "proxy" object with our custom functions. Everything
   // else is proxied back to the shared logger instance via prototype
   // inheritance.
   let logProxy = {__proto__: log};
 
   // Automatically prefix all log messages with the identifier.
-  for (let level in Log.Level) {
+  for (let level in Log4Moz.Level) {
     if (level == "Desc") {
       continue;
     }
 
     let lc = level.toLowerCase();
     logProxy[lc] = function (msg) {
       return log[lc].call(log, "Conn #" + number + ": " + msg);
     };
@@ -740,17 +740,17 @@ OpenedConnection.prototype = Object.free
 
     let deferred = Promise.defer();
     let userCancelled = false;
     let errors = [];
     let rows = [];
 
     // Don't incur overhead for serializing params unless the messages go
     // somewhere.
-    if (this._log.level <= Log.Level.Trace) {
+    if (this._log.level <= Log4Moz.Level.Trace) {
       let msg = "Stmt #" + index + " " + sql;
 
       if (params) {
         msg += " - " + JSON.stringify(params);
       }
       this._log.trace(msg);
     } else {
       this._log.debug("Stmt #" + index + " starting");
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -12,17 +12,16 @@ EXTRA_JS_MODULES += [
     'Deprecated.jsm',
     'Dict.jsm',
     'FileUtils.jsm',
     'Finder.jsm',
     'Geometry.jsm',
     'Http.jsm',
     'InlineSpellChecker.jsm',
     'LoadContextInfo.jsm',
-    'Log.jsm',
     'NewTabUtils.jsm',
     'PageMenu.jsm',
     'PermissionsUtils.jsm',
     'PopupNotifications.jsm',
     'Preferences.jsm',
     'PrivateBrowsingUtils.jsm',
     'Promise.jsm',
     'PropertyListUtils.jsm',
--- a/toolkit/modules/tests/xpcshell/xpcshell.ini
+++ b/toolkit/modules/tests/xpcshell/xpcshell.ini
@@ -5,17 +5,16 @@ support-files =
   propertyLists/bug710259_propertyListBinary.plist
   propertyLists/bug710259_propertyListXML.plist
   chromeappsstore.sqlite
 
 [test_AsyncShutdown.js]
 [test_dict.js]
 [test_FileUtils.js]
 [test_Http.js]
-[test_Log.js]
 [test_PermissionsUtils.js]
 [test_Preferences.js]
 [test_Promise.js]
 [test_propertyListsUtils.js]
 [test_readCertPrefs.js]
 [test_Services.js]
 [test_sqlite.js]
 [test_task.js]