You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/07/11 20:07:47 UTC

[GitHub] ccollins476ad closed pull request #1249: Switch everything over to modlog

ccollins476ad closed pull request #1249: Switch everything over to modlog
URL: https://github.com/apache/mynewt-core/pull/1249
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apps/blecent/pkg.yml b/apps/blecent/pkg.yml
index 29dae6394b..6ac4b3d74b 100644
--- a/apps/blecent/pkg.yml
+++ b/apps/blecent/pkg.yml
@@ -33,4 +33,5 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
diff --git a/apps/blecent/src/blecent.h b/apps/blecent/src/blecent.h
index 2d598644cd..cce13954c7 100644
--- a/apps/blecent/src/blecent.h
+++ b/apps/blecent/src/blecent.h
@@ -21,7 +21,7 @@
 #define H_BLECENT_
 
 #include "os/mynewt.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -32,15 +32,6 @@ struct ble_hs_cfg;
 union ble_store_value;
 union ble_store_key;
 
-extern struct log blecent_log;
-
-/* blecent uses the first "peruser" log module. */
-#define BLECENT_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the blecent module. */
-#define BLECENT_LOG(lvl, ...) \
-    LOG_ ## lvl(&blecent_log, BLECENT_LOG_MODULE, __VA_ARGS__)
-
 #define BLECENT_SVC_ALERT_UUID              0x1811
 #define BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID  0x2A47
 #define BLECENT_CHR_NEW_ALERT               0x2A46
diff --git a/apps/blecent/src/main.c b/apps/blecent/src/main.c
index ff44fbf955..f14da346af 100644
--- a/apps/blecent/src/main.c
+++ b/apps/blecent/src/main.c
@@ -38,9 +38,6 @@
 /* Application-specified header. */
 #include "blecent.h"
 
-/** Log data. */
-struct log blecent_log;
-
 static int blecent_gap_event(struct ble_gap_event *event, void *arg);
 
 /**
@@ -53,13 +50,13 @@ blecent_on_read(uint16_t conn_handle,
                 struct ble_gatt_attr *attr,
                 void *arg)
 {
-    BLECENT_LOG(INFO, "Read complete; status=%d conn_handle=%d", error->status,
+    MODLOG_DFLT(INFO, "Read complete; status=%d conn_handle=%d", error->status,
                 conn_handle);
     if (error->status == 0) {
-        BLECENT_LOG(INFO, " attr_handle=%d value=", attr->handle);
+        MODLOG_DFLT(INFO, " attr_handle=%d value=", attr->handle);
         print_mbuf(attr->om);
     }
-    BLECENT_LOG(INFO, "\n");
+    MODLOG_DFLT(INFO, "\n");
 
     return 0;
 }
@@ -74,8 +71,8 @@ blecent_on_write(uint16_t conn_handle,
                  struct ble_gatt_attr *attr,
                  void *arg)
 {
-    BLECENT_LOG(INFO, "Write complete; status=%d conn_handle=%d "
-                      "attr_handle=%d\n",
+    MODLOG_DFLT(INFO,
+                "Write complete; status=%d conn_handle=%d attr_handle=%d\n",
                 error->status, conn_handle, attr->handle);
 
     return 0;
@@ -91,7 +88,7 @@ blecent_on_subscribe(uint16_t conn_handle,
                      struct ble_gatt_attr *attr,
                      void *arg)
 {
-    BLECENT_LOG(INFO, "Subscribe complete; status=%d conn_handle=%d "
+    MODLOG_DFLT(INFO, "Subscribe complete; status=%d conn_handle=%d "
                       "attr_handle=%d\n",
                 error->status, conn_handle, attr->handle);
 
@@ -123,7 +120,7 @@ blecent_read_write_subscribe(const struct peer *peer)
                              BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID),
                              BLE_UUID16_DECLARE(BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID));
     if (chr == NULL) {
-        BLECENT_LOG(ERROR, "Error: Peer doesn't support the Supported New "
+        MODLOG_DFLT(ERROR, "Error: Peer doesn't support the Supported New "
                            "Alert Category characteristic\n");
         goto err;
     }
@@ -131,7 +128,7 @@ blecent_read_write_subscribe(const struct peer *peer)
     rc = ble_gattc_read(peer->conn_handle, chr->chr.val_handle,
                         blecent_on_read, NULL);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "Error: Failed to read characteristic; rc=%d\n",
+        MODLOG_DFLT(ERROR, "Error: Failed to read characteristic; rc=%d\n",
                     rc);
         goto err;
     }
@@ -143,7 +140,7 @@ blecent_read_write_subscribe(const struct peer *peer)
                              BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID),
                              BLE_UUID16_DECLARE(BLECENT_CHR_ALERT_NOT_CTRL_PT));
     if (chr == NULL) {
-        BLECENT_LOG(ERROR, "Error: Peer doesn't support the Alert "
+        MODLOG_DFLT(ERROR, "Error: Peer doesn't support the Alert "
                            "Notification Control Point characteristic\n");
         goto err;
     }
@@ -153,7 +150,7 @@ blecent_read_write_subscribe(const struct peer *peer)
     rc = ble_gattc_write_flat(peer->conn_handle, chr->chr.val_handle,
                               value, sizeof value, blecent_on_write, NULL);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "Error: Failed to write characteristic; rc=%d\n",
+        MODLOG_DFLT(ERROR, "Error: Failed to write characteristic; rc=%d\n",
                     rc);
     }
 
@@ -166,7 +163,7 @@ blecent_read_write_subscribe(const struct peer *peer)
                              BLE_UUID16_DECLARE(BLECENT_CHR_UNR_ALERT_STAT_UUID),
                              BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16));
     if (dsc == NULL) {
-        BLECENT_LOG(ERROR, "Error: Peer lacks a CCCD for the Unread Alert "
+        MODLOG_DFLT(ERROR, "Error: Peer lacks a CCCD for the Unread Alert "
                            "Status characteristic\n");
         goto err;
     }
@@ -176,7 +173,7 @@ blecent_read_write_subscribe(const struct peer *peer)
     rc = ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle,
                               value, sizeof value, blecent_on_subscribe, NULL);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "Error: Failed to subscribe to characteristic; "
+        MODLOG_DFLT(ERROR, "Error: Failed to subscribe to characteristic; "
                            "rc=%d\n", rc);
         goto err;
     }
@@ -197,7 +194,7 @@ blecent_on_disc_complete(const struct peer *peer, int status, void *arg)
 
     if (status != 0) {
         /* Service discovery failed.  Terminate the connection. */
-        BLECENT_LOG(ERROR, "Error: Service discovery failed; status=%d "
+        MODLOG_DFLT(ERROR, "Error: Service discovery failed; status=%d "
                            "conn_handle=%d\n", status, peer->conn_handle);
         ble_gap_terminate(peer->conn_handle, BLE_ERR_REM_USER_CONN_TERM);
         return;
@@ -207,7 +204,7 @@ blecent_on_disc_complete(const struct peer *peer, int status, void *arg)
      * list of services, characteristics, and descriptors that the peer
      * supports.
      */
-    BLECENT_LOG(ERROR, "Service discovery complete; status=%d "
+    MODLOG_DFLT(ERROR, "Service discovery complete; status=%d "
                        "conn_handle=%d\n", status, peer->conn_handle);
 
     /* Now perform three concurrent GATT procedures against the peer: read,
@@ -229,7 +226,7 @@ blecent_scan(void)
     /* Figure out address to use while advertising (no privacy for now) */
     rc = ble_hs_id_infer_auto(0, &own_addr_type);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "error determining address type; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error determining address type; rc=%d\n", rc);
         return;
     }
 
@@ -253,7 +250,7 @@ blecent_scan(void)
     rc = ble_gap_disc(own_addr_type, BLE_HS_FOREVER, &disc_params,
                       blecent_gap_event, NULL);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "Error initiating GAP discovery procedure; rc=%d\n",
+        MODLOG_DFLT(ERROR, "Error initiating GAP discovery procedure; rc=%d\n",
                     rc);
     }
 }
@@ -312,7 +309,7 @@ blecent_connect_if_interesting(const struct ble_gap_disc_desc *disc)
     /* Scanning must be stopped before a connection can be initiated. */
     rc = ble_gap_disc_cancel();
     if (rc != 0) {
-        BLECENT_LOG(DEBUG, "Failed to cancel scan; rc=%d\n", rc);
+        MODLOG_DFLT(DEBUG, "Failed to cancel scan; rc=%d\n", rc);
         return;
     }
 
@@ -322,9 +319,9 @@ blecent_connect_if_interesting(const struct ble_gap_disc_desc *disc)
     rc = ble_gap_connect(BLE_OWN_ADDR_PUBLIC, &disc->addr, 30000, NULL,
                          blecent_gap_event, NULL);
     if (rc != 0) {
-        BLECENT_LOG(ERROR, "Error: Failed to connect to device; addr_type=%d "
-                           "addr=%s\n", disc->addr.type,
-                           addr_str(disc->addr.val));
+        MODLOG_DFLT(ERROR, "Error: Failed to connect to device; addr_type=%d "
+                           "addr=%s\n",
+                    disc->addr.type, addr_str(disc->addr.val));
         return;
     }
 }
@@ -369,17 +366,17 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
         /* A new connection was established or a connection attempt failed. */
         if (event->connect.status == 0) {
             /* Connection successfully established. */
-            BLECENT_LOG(INFO, "Connection established ");
+            MODLOG_DFLT(INFO, "Connection established ");
 
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             print_conn_desc(&desc);
-            BLECENT_LOG(INFO, "\n");
+            MODLOG_DFLT(INFO, "\n");
 
             /* Remember peer. */
             rc = peer_add(event->connect.conn_handle);
             if (rc != 0) {
-                BLECENT_LOG(ERROR, "Failed to add peer; rc=%d\n", rc);
+                MODLOG_DFLT(ERROR, "Failed to add peer; rc=%d\n", rc);
                 return 0;
             }
 
@@ -387,12 +384,12 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
             rc = peer_disc_all(event->connect.conn_handle,
                                blecent_on_disc_complete, NULL);
             if (rc != 0) {
-                BLECENT_LOG(ERROR, "Failed to discover services; rc=%d\n", rc);
+                MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
                 return 0;
             }
         } else {
             /* Connection attempt failed; resume scanning. */
-            BLECENT_LOG(ERROR, "Error: Connection failed; status=%d\n",
+            MODLOG_DFLT(ERROR, "Error: Connection failed; status=%d\n",
                         event->connect.status);
             blecent_scan();
         }
@@ -401,9 +398,9 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_DISCONNECT:
         /* Connection terminated. */
-        BLECENT_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         print_conn_desc(&event->disconnect.conn);
-        BLECENT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Forget about peer. */
         peer_delete(event->disconnect.conn.conn_handle);
@@ -413,13 +410,13 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISC_COMPLETE:
-        BLECENT_LOG(INFO, "discovery complete; reason=%d\n",
+        MODLOG_DFLT(INFO, "discovery complete; reason=%d\n",
                     event->disc_complete.reason);
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BLECENT_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc);
         assert(rc == 0);
@@ -428,7 +425,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_NOTIFY_RX:
         /* Peer sent us a notification or indication. */
-        BLECENT_LOG(INFO, "received %s; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "received %s; conn_handle=%d attr_handle=%d "
                           "attr_len=%d\n",
                     event->notify_rx.indication ?
                         "indication" :
@@ -441,7 +438,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BLECENT_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -471,7 +468,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
 static void
 blecent_on_reset(int reason)
 {
-    BLECENT_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -502,13 +499,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the blecent log. */
-    log_register("blecent", &blecent_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Configure the host. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = blecent_on_reset;
     ble_hs_cfg.sync_cb = blecent_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/blecent/src/misc.c b/apps/blecent/src/misc.c
index eb4af0cc18..6813a12264 100644
--- a/apps/blecent/src/misc.c
+++ b/apps/blecent/src/misc.c
@@ -33,7 +33,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BLECENT_LOG(DEBUG, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(DEBUG, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -45,7 +45,7 @@ print_mbuf(const struct os_mbuf *om)
     colon = 0;
     while (om != NULL) {
         if (colon) {
-            BLECENT_LOG(DEBUG, ":");
+            MODLOG_DFLT(DEBUG, ":");
         } else {
             colon = 1;
         }
@@ -72,7 +72,7 @@ print_uuid(const ble_uuid_t *uuid)
 {
     char buf[BLE_UUID_STR_LEN];
 
-    BLECENT_LOG(DEBUG, "%s", ble_uuid_to_str(uuid, buf));
+    MODLOG_DFLT(DEBUG, "%s", ble_uuid_to_str(uuid, buf));
 }
 
 /**
@@ -81,16 +81,16 @@ print_uuid(const ble_uuid_t *uuid)
 void
 print_conn_desc(const struct ble_gap_conn_desc *desc)
 {
-    BLECENT_LOG(DEBUG, "handle=%d our_ota_addr_type=%d our_ota_addr=%s ",
+    MODLOG_DFLT(DEBUG, "handle=%d our_ota_addr_type=%d our_ota_addr=%s ",
                 desc->conn_handle, desc->our_ota_addr.type,
                 addr_str(desc->our_ota_addr.val));
-    BLECENT_LOG(DEBUG, "our_id_addr_type=%d our_id_addr=%s ",
+    MODLOG_DFLT(DEBUG, "our_id_addr_type=%d our_id_addr=%s ",
                 desc->our_id_addr.type, addr_str(desc->our_id_addr.val));
-    BLECENT_LOG(DEBUG, "peer_ota_addr_type=%d peer_ota_addr=%s ",
+    MODLOG_DFLT(DEBUG, "peer_ota_addr_type=%d peer_ota_addr=%s ",
                 desc->peer_ota_addr.type, addr_str(desc->peer_ota_addr.val));
-    BLECENT_LOG(DEBUG, "peer_id_addr_type=%d peer_id_addr=%s ",
+    MODLOG_DFLT(DEBUG, "peer_id_addr_type=%d peer_id_addr=%s ",
                 desc->peer_id_addr.type, addr_str(desc->peer_id_addr.val));
-    BLECENT_LOG(DEBUG, "conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(DEBUG, "conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
@@ -108,102 +108,102 @@ print_adv_fields(const struct ble_hs_adv_fields *fields)
     int i;
 
     if (fields->flags != 0) {
-        BLECENT_LOG(DEBUG, "    flags=0x%02x\n", fields->flags);
+        MODLOG_DFLT(DEBUG, "    flags=0x%02x\n", fields->flags);
     }
 
     if (fields->uuids16 != NULL) {
-        BLECENT_LOG(DEBUG, "    uuids16(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids16(%scomplete)=",
                     fields->uuids16_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids16; i++) {
             print_uuid(&fields->uuids16[i].u);
-            BLECENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uuids32 != NULL) {
-        BLECENT_LOG(DEBUG, "    uuids32(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids32(%scomplete)=",
                     fields->uuids32_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids32; i++) {
             print_uuid(&fields->uuids32[i].u);
-            BLECENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uuids128 != NULL) {
-        BLECENT_LOG(DEBUG, "    uuids128(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids128(%scomplete)=",
                     fields->uuids128_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids128; i++) {
             print_uuid(&fields->uuids128[i].u);
-            BLECENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->name != NULL) {
         assert(fields->name_len < sizeof s - 1);
         memcpy(s, fields->name, fields->name_len);
         s[fields->name_len] = '\0';
-        BLECENT_LOG(DEBUG, "    name(%scomplete)=%s\n",
+        MODLOG_DFLT(DEBUG, "    name(%scomplete)=%s\n",
                     fields->name_is_complete ? "" : "in", s);
     }
 
     if (fields->tx_pwr_lvl_is_present) {
-        BLECENT_LOG(DEBUG, "    tx_pwr_lvl=%d\n", fields->tx_pwr_lvl);
+        MODLOG_DFLT(DEBUG, "    tx_pwr_lvl=%d\n", fields->tx_pwr_lvl);
     }
 
     if (fields->slave_itvl_range != NULL) {
-        BLECENT_LOG(DEBUG, "    slave_itvl_range=");
+        MODLOG_DFLT(DEBUG, "    slave_itvl_range=");
         print_bytes(fields->slave_itvl_range, BLE_HS_ADV_SLAVE_ITVL_RANGE_LEN);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->svc_data_uuid16 != NULL) {
-        BLECENT_LOG(DEBUG, "    svc_data_uuid16=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid16=");
         print_bytes(fields->svc_data_uuid16, fields->svc_data_uuid16_len);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->public_tgt_addr != NULL) {
-        BLECENT_LOG(DEBUG, "    public_tgt_addr=");
+        MODLOG_DFLT(DEBUG, "    public_tgt_addr=");
         u8p = fields->public_tgt_addr;
         for (i = 0; i < fields->num_public_tgt_addrs; i++) {
-            BLECENT_LOG(DEBUG, "public_tgt_addr=%s ", addr_str(u8p));
+            MODLOG_DFLT(DEBUG, "public_tgt_addr=%s ", addr_str(u8p));
             u8p += BLE_HS_ADV_PUBLIC_TGT_ADDR_ENTRY_LEN;
         }
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->appearance_is_present) {
-        BLECENT_LOG(DEBUG, "    appearance=0x%04x\n", fields->appearance);
+        MODLOG_DFLT(DEBUG, "    appearance=0x%04x\n", fields->appearance);
     }
 
     if (fields->adv_itvl_is_present) {
-        BLECENT_LOG(DEBUG, "    adv_itvl=0x%04x\n", fields->adv_itvl);
+        MODLOG_DFLT(DEBUG, "    adv_itvl=0x%04x\n", fields->adv_itvl);
     }
 
     if (fields->svc_data_uuid32 != NULL) {
-        BLECENT_LOG(DEBUG, "    svc_data_uuid32=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid32=");
         print_bytes(fields->svc_data_uuid32, fields->svc_data_uuid32_len);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->svc_data_uuid128 != NULL) {
-        BLECENT_LOG(DEBUG, "    svc_data_uuid128=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid128=");
         print_bytes(fields->svc_data_uuid128, fields->svc_data_uuid128_len);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uri != NULL) {
-        BLECENT_LOG(DEBUG, "    uri=");
+        MODLOG_DFLT(DEBUG, "    uri=");
         print_bytes(fields->uri, fields->uri_len);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->mfg_data != NULL) {
-        BLECENT_LOG(DEBUG, "    mfg_data=");
+        MODLOG_DFLT(DEBUG, "    mfg_data=");
         print_bytes(fields->mfg_data, fields->mfg_data_len);
-        BLECENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 }
diff --git a/apps/blecsc/pkg.yml b/apps/blecsc/pkg.yml
index 860ec4a34f..8ccbe5caeb 100644
--- a/apps/blecsc/pkg.yml
+++ b/apps/blecsc/pkg.yml
@@ -35,6 +35,7 @@ pkg.deps:
     - net/nimble/transport
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/sysinit
     - sys/id
diff --git a/apps/blecsc/src/blecsc_sens.h b/apps/blecsc/src/blecsc_sens.h
index a73a3b8be0..a06af831af 100644
--- a/apps/blecsc/src/blecsc_sens.h
+++ b/apps/blecsc/src/blecsc_sens.h
@@ -20,22 +20,13 @@
 #ifndef H_BLECSC_SENSOR_
 #define H_BLECSC_SENSOR_
 
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "nimble/ble.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern struct log blecsc_log;
-
-/* blecsc uses the first "peruser" log module */
-#define BLECSC_LOG_MODULE (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the blerh module */
-#define BLECSC_LOG(lvl, ...) \
-    LOG_ ## lvl(&blecsc_log, BLECSC_LOG_MODULE, __VA_ARGS__)
-
 /* Cycling Speed and Cadence configuration */
 #define GATT_CSC_UUID                           0x1816
 #define GATT_CSC_MEASUREMENT_UUID               0x2A5B
diff --git a/apps/blecsc/src/gatt_svr.c b/apps/blecsc/src/gatt_svr.c
index e17a38ed2d..3c81d74592 100644
--- a/apps/blecsc/src/gatt_svr.c
+++ b/apps/blecsc/src/gatt_svr.c
@@ -178,8 +178,8 @@ gatt_svr_chr_access_sc_control_point(uint16_t conn_handle,
     assert(ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR);
 
     if (!csc_cp_indication_status) {
-        BLECSC_LOG(INFO, "SC Control Point; CCC descriptor "
-                         "improperly configured");
+        MODLOG_DFLT(INFO, "SC Control Point; CCC descriptor "
+                          "improperly configured");
         return CSC_ERR_CCC_DESC_IMPROPERLY_CONFIGURED;
     }
     
@@ -188,7 +188,7 @@ gatt_svr_chr_access_sc_control_point(uint16_t conn_handle,
     if (rc != 0){
         return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
     }
-    BLECSC_LOG(INFO, "SC Control Point; opcode=%d\n", op_code);  
+    MODLOG_DFLT(INFO, "SC Control Point; opcode=%d\n", op_code);  
  
     /* Allocate response buffer */
     om_indication = ble_hs_mbuf_att_pkt();
@@ -207,8 +207,8 @@ gatt_svr_chr_access_sc_control_point(uint16_t conn_handle,
         measurement_state->cumulative_wheel_rev = 
                            get_le32(new_cumulative_wheel_rev_arr);
         
-        BLECSC_LOG(INFO, "SC Control Point; Set cumulative value = %d\n", 
-                          measurement_state->cumulative_wheel_rev);  
+        MODLOG_DFLT(INFO, "SC Control Point; Set cumulative value = %d\n", 
+                    measurement_state->cumulative_wheel_rev);  
                         
         response = SC_CP_RESPONSE_SUCCESS;                         
         break;
@@ -222,8 +222,8 @@ gatt_svr_chr_access_sc_control_point(uint16_t conn_handle,
           return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN;
         }
         
-        BLECSC_LOG(INFO, "SC Control Point; Sensor location update = %d\n", 
-                         new_sensor_location);         
+        MODLOG_DFLT(INFO, "SC Control Point; Sensor location update = %d\n", 
+                    new_sensor_location);         
         
         /* Verify if requested new location is on supported locations list */
         response = SC_CP_RESPONSE_INVALID_PARAM;
@@ -338,13 +338,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BLECSC_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BLECSC_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -352,7 +352,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BLECSC_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/blecsc/src/main.c b/apps/blecsc/src/main.c
index de9c260039..1b1e9c33c2 100644
--- a/apps/blecsc/src/main.c
+++ b/apps/blecsc/src/main.c
@@ -41,9 +41,6 @@
 /* Simulated speed upper limit */
 #define CSC_SIM_SPEED_KPH_MAX                     35
 
-/* Log data */
-struct log blecsc_log;
-
 /* Noticication status */
 static bool notify_state = false;
 
@@ -118,7 +115,7 @@ blecsc_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLECSC_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -129,7 +126,7 @@ blecsc_advertise(void)
     rc = ble_gap_adv_start(blecsc_addr_type, NULL, BLE_HS_FOREVER,
                            &adv_params, blecsc_gap_event, NULL);
     if (rc != 0) {
-        BLECSC_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -180,8 +177,8 @@ blecsc_simulate_speed_and_cadence()
         csc_measurement_state.last_crank_evt_time += crank_rev_period; 
     }    
     
-    BLECSC_LOG(INFO, "CSC simulated values: speed = %d kph, cadence = %d \n",
-                    csc_sim_speed_kph, csc_sim_crank_rpm);  
+    MODLOG_DFLT(INFO, "CSC simulated values: speed = %d kph, cadence = %d \n",
+                csc_sim_speed_kph, csc_sim_crank_rpm);  
 }
 
 /* Run CSC measurement simulation and notify it to the client */
@@ -207,7 +204,7 @@ blecsc_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed */
-        BLECSC_LOG(INFO, "connection %s; status=%d\n",
+        MODLOG_DFLT(INFO, "connection %s; status=%d\n",
                     event->connect.status == 0 ? "established" : "failed",
                     event->connect.status);
 
@@ -222,34 +219,34 @@ blecsc_gap_event(struct ble_gap_event *event, void *arg)
         break;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLECSC_LOG(INFO, "disconnect; reason=%d\n", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d\n", event->disconnect.reason);
         conn_handle = 0;
         /* Connection terminated; resume advertising */
         blecsc_advertise();
         break;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLECSC_LOG(INFO, "adv complete\n");
+        MODLOG_DFLT(INFO, "adv complete\n");
         break;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLECSC_LOG(INFO, "subscribe event attr_handle=%d\n",
-                         event->subscribe.attr_handle);
+        MODLOG_DFLT(INFO, "subscribe event attr_handle=%d\n",
+                    event->subscribe.attr_handle);
 
         if (event->subscribe.attr_handle == csc_measurement_handle) {
             notify_state = event->subscribe.cur_notify;
-            BLECSC_LOG(INFO, "csc measurement notify state = %d\n",
-                              notify_state);
+            MODLOG_DFLT(INFO, "csc measurement notify state = %d\n",
+                        notify_state);
         } 
         else if (event->subscribe.attr_handle == csc_control_point_handle) {
             gatt_svr_set_cp_indicate(event->subscribe.cur_indicate);
-            BLECSC_LOG(INFO, "csc control point indicate state = %d\n",
-                              event->subscribe.cur_indicate);            
+            MODLOG_DFLT(INFO, "csc control point indicate state = %d\n",
+                        event->subscribe.cur_indicate);            
         }
         break;
 
     case BLE_GAP_EVENT_MTU:
-        BLECSC_LOG(INFO, "mtu update event; conn_handle=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.value);
         break;
@@ -288,13 +285,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the blecsc log */
-    log_register("blecsc_sens_log", &blecsc_log, &log_console_handler, NULL,
-                    LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration */
-    log_register("blecsc_sens", &ble_hs_log, &log_console_handler, NULL,
-                    LOG_SYSLEVEL);
     ble_hs_cfg.sync_cb = blecsc_on_sync;
 
     /* Initialize measurement and notification timer */
diff --git a/apps/blehr/pkg.yml b/apps/blehr/pkg.yml
index 6c67270e8a..7c2c745ba6 100644
--- a/apps/blehr/pkg.yml
+++ b/apps/blehr/pkg.yml
@@ -35,6 +35,7 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/sysinit
     - sys/id
diff --git a/apps/blehr/src/blehr_sens.h b/apps/blehr/src/blehr_sens.h
index 2eec9ddf45..a3f59ca94f 100644
--- a/apps/blehr/src/blehr_sens.h
+++ b/apps/blehr/src/blehr_sens.h
@@ -20,22 +20,13 @@
 #ifndef H_BLEHR_SENSOR_
 #define H_BLEHR_SENSOR_
 
-#include "log/log.h"
 #include "nimble/ble.h"
+#include "modlog/modlog.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern struct log blehr_log;
-
-/* blehr uses the first "peruser" log module */
-#define BLEHR_LOG_MODULE (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the blerh module */
-#define BLEHR_LOG(lvl, ...) \
-    LOG_ ## lvl(&blehr_log, BLEHR_LOG_MODULE, __VA_ARGS__)
-
 /* Heart-rate configuration */
 #define GATT_HRS_UUID                           0x180D
 #define GATT_HRS_MEASUREMENT_UUID               0x2A37
diff --git a/apps/blehr/src/gatt_svr.c b/apps/blehr/src/gatt_svr.c
index eac843e8ab..b2e9b4e0af 100644
--- a/apps/blehr/src/gatt_svr.c
+++ b/apps/blehr/src/gatt_svr.c
@@ -132,13 +132,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BLEHR_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BLEHR_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -146,7 +146,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BLEHR_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/blehr/src/main.c b/apps/blehr/src/main.c
index e538beeb76..217c2b126d 100644
--- a/apps/blehr/src/main.c
+++ b/apps/blehr/src/main.c
@@ -30,9 +30,6 @@
 #include "services/gap/ble_svc_gap.h"
 #include "blehr_sens.h"
 
-/* Log data */
-struct log blehr_log;
-
 static bool notify_state;
 
 static const char *device_name = "blehr_sensor";
@@ -89,7 +86,7 @@ blehr_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLEHR_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -100,7 +97,7 @@ blehr_advertise(void)
     rc = ble_gap_adv_start(blehr_addr_type, NULL, BLE_HS_FOREVER,
                            &adv_params, blehr_gap_event, NULL);
     if (rc != 0) {
-        BLEHR_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -158,7 +155,7 @@ blehr_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed */
-        BLEHR_LOG(INFO, "connection %s; status=%d\n",
+        MODLOG_DFLT(INFO, "connection %s; status=%d\n",
                     event->connect.status == 0 ? "established" : "failed",
                     event->connect.status);
 
@@ -169,22 +166,21 @@ blehr_gap_event(struct ble_gap_event *event, void *arg)
         break;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLEHR_LOG(INFO, "disconnect; reason=%d\n", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d\n", event->disconnect.reason);
 
         /* Connection terminated; resume advertising */
         blehr_advertise();
         break;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLEHR_LOG(INFO, "adv complete\n");
+        MODLOG_DFLT(INFO, "adv complete\n");
         blehr_advertise();
         break;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLEHR_LOG(INFO, "subscribe event; cur_notify=%d\n value handle; "
-                  "val_handle=%d\n",
-                        event->subscribe.cur_notify,
-                        hrs_hrm_handle);
+        MODLOG_DFLT(INFO, "subscribe event; cur_notify=%d\n value handle; "
+                          "val_handle=%d\n",
+                    event->subscribe.cur_notify, hrs_hrm_handle);
         if (event->subscribe.attr_handle == hrs_hrm_handle) {
             notify_state = event->subscribe.cur_notify;
             blehr_tx_hrate_reset();
@@ -195,7 +191,7 @@ blehr_gap_event(struct ble_gap_event *event, void *arg)
         break;
 
     case BLE_GAP_EVENT_MTU:
-        BLEHR_LOG(INFO, "mtu update event; conn_handle=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.value);
         break;
@@ -234,13 +230,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the blehr log */
-    log_register("blehr_sens_log", &blehr_log, &log_console_handler, NULL,
-                    LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration */
-    log_register("blehr_sens", &ble_hs_log, &log_console_handler, NULL,
-                    LOG_SYSLEVEL);
     ble_hs_cfg.sync_cb = blehr_on_sync;
 
     os_callout_init(&blehr_tx_timer, os_eventq_dflt_get(),
diff --git a/apps/blemesh/pkg.yml b/apps/blemesh/pkg.yml
index 50ec78e577..57ab392ddf 100644
--- a/apps/blemesh/pkg.yml
+++ b/apps/blemesh/pkg.yml
@@ -32,5 +32,6 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/shell
diff --git a/apps/blemesh/src/main.c b/apps/blemesh/src/main.c
index 105ec6f9b2..e0c2ebb890 100644
--- a/apps/blemesh/src/main.c
+++ b/apps/blemesh/src/main.c
@@ -419,8 +419,6 @@ main(int argc, char **argv)
     sysinit();
 
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = blemesh_on_reset;
     ble_hs_cfg.sync_cb = blemesh_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/blemesh_light/pkg.yml b/apps/blemesh_light/pkg.yml
index 642cbba9fc..c3b6b4828e 100644
--- a/apps/blemesh_light/pkg.yml
+++ b/apps/blemesh_light/pkg.yml
@@ -32,5 +32,6 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/shell
diff --git a/apps/blemesh_light/src/main.c b/apps/blemesh_light/src/main.c
index 4bab1ed38b..009dd6481a 100755
--- a/apps/blemesh_light/src/main.c
+++ b/apps/blemesh_light/src/main.c
@@ -109,8 +109,6 @@ main(void)
     sysinit();
 
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = blemesh_on_reset;
     ble_hs_cfg.sync_cb = blemesh_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/blemesh_shell/pkg.yml b/apps/blemesh_shell/pkg.yml
index 7febc36917..6e54497d24 100644
--- a/apps/blemesh_shell/pkg.yml
+++ b/apps/blemesh_shell/pkg.yml
@@ -32,5 +32,6 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/shell
diff --git a/apps/blemesh_shell/src/main.c b/apps/blemesh_shell/src/main.c
index 32aa28ad7b..eb1dfb52a2 100644
--- a/apps/blemesh_shell/src/main.c
+++ b/apps/blemesh_shell/src/main.c
@@ -99,8 +99,6 @@ main(void)
     sysinit();
 
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = blemesh_on_reset;
     ble_hs_cfg.sync_cb = blemesh_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/bleprph/pkg.yml b/apps/bleprph/pkg.yml
index 9288db901a..fd0bb20208 100644
--- a/apps/bleprph/pkg.yml
+++ b/apps/bleprph/pkg.yml
@@ -38,6 +38,7 @@ pkg.deps:
     - net/nimble/transport
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/sysinit
     - sys/id
diff --git a/apps/bleprph/src/bleprph.h b/apps/bleprph/src/bleprph.h
index ec14445946..7d2c80a8f8 100644
--- a/apps/bleprph/src/bleprph.h
+++ b/apps/bleprph/src/bleprph.h
@@ -21,8 +21,8 @@
 #define H_BLEPRPH_
 
 #include <stdbool.h>
-#include "log/log.h"
 #include "nimble/ble.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -30,15 +30,6 @@ extern "C" {
 struct ble_hs_cfg;
 struct ble_gatt_register_ctxt;
 
-extern struct log bleprph_log;
-
-/* bleprph uses the first "peruser" log module. */
-#define BLEPRPH_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bleprph module. */
-#define BLEPRPH_LOG(lvl, ...) \
-    LOG_ ## lvl(&bleprph_log, BLEPRPH_LOG_MODULE, __VA_ARGS__)
-
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
 #define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
diff --git a/apps/bleprph/src/gatt_svr.c b/apps/bleprph/src/gatt_svr.c
index 7025aaf354..632ef4fb01 100644
--- a/apps/bleprph/src/gatt_svr.c
+++ b/apps/bleprph/src/gatt_svr.c
@@ -160,13 +160,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BLEPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BLEPRPH_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -174,7 +174,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BLEPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/bleprph/src/main.c b/apps/bleprph/src/main.c
index 29296cc2d9..cae7c2faba 100644
--- a/apps/bleprph/src/main.c
+++ b/apps/bleprph/src/main.c
@@ -38,9 +38,6 @@
 /* Application-specified header. */
 #include "bleprph.h"
 
-/** Log data. */
-struct log bleprph_log;
-
 static int bleprph_gap_event(struct ble_gap_event *event, void *arg);
 
 /**
@@ -49,19 +46,19 @@ static int bleprph_gap_event(struct ble_gap_event *event, void *arg);
 static void
 bleprph_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BLEPRPH_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    BLEPRPH_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    BLEPRPH_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    BLEPRPH_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    BLEPRPH_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
@@ -87,7 +84,7 @@ bleprph_advertise(void)
     /* Figure out address to use while advertising (no privacy for now) */
     rc = ble_hs_id_infer_auto(0, &own_addr_type);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error determining address type; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error determining address type; rc=%d\n", rc);
         return;
     }
 
@@ -128,7 +125,7 @@ bleprph_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -139,7 +136,7 @@ bleprph_advertise(void)
     rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER,
                            &adv_params, bleprph_gap_event, NULL);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -168,9 +165,9 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        BLEPRPH_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
@@ -180,7 +177,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
             phy_conn_changed(event->connect.conn_handle);
 #endif
         }
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -189,9 +186,9 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLEPRPH_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         bleprph_print_conn_desc(&event->disconnect.conn);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
 #if MYNEWT_VAL(BLEPRPH_LE_PHY_SUPPORT)
         phy_conn_changed(CONN_HANDLE_INVALID);
@@ -203,32 +200,32 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        BLEPRPH_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bleprph_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLEPRPH_LOG(INFO, "advertise complete; reason=%d",
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d",
                     event->adv_complete.reason);
         bleprph_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BLEPRPH_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bleprph_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLEPRPH_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -240,7 +237,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BLEPRPH_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -276,7 +273,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 static void
 bleprph_on_reset(int reason)
 {
-    BLEPRPH_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -308,13 +305,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the bleprph log. */
-    log_register("bleprph", &bleprph_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = bleprph_on_reset;
     ble_hs_cfg.sync_cb = bleprph_on_sync;
     ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb;
diff --git a/apps/bleprph/src/misc.c b/apps/bleprph/src/misc.c
index 8ec785e511..640b7ff8b6 100644
--- a/apps/bleprph/src/misc.c
+++ b/apps/bleprph/src/misc.c
@@ -28,7 +28,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BLEPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -38,6 +38,6 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    BLEPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
                 u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
diff --git a/apps/bleprph_oic/pkg.yml b/apps/bleprph_oic/pkg.yml
index ebfc50609c..de1faee53a 100644
--- a/apps/bleprph_oic/pkg.yml
+++ b/apps/bleprph_oic/pkg.yml
@@ -33,6 +33,7 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - mgmt/oicmgr
     - sys/sysinit
diff --git a/apps/bleprph_oic/src/bleprph.h b/apps/bleprph_oic/src/bleprph.h
index 2e3f024737..d14b53a97a 100644
--- a/apps/bleprph_oic/src/bleprph.h
+++ b/apps/bleprph_oic/src/bleprph.h
@@ -20,7 +20,8 @@
 #ifndef H_BLEPRPH_
 #define H_BLEPRPH_
 
-#include "log/log.h"
+#include "os/mynewt.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -30,13 +31,6 @@ struct ble_gatt_register_ctxt;
 
 extern struct log bleprph_log;
 
-/* bleprph uses the first "peruser" log module. */
-#define BLEPRPH_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bleprph module. */
-#define BLEPRPH_LOG(lvl, ...) \
-    LOG_ ## lvl(&bleprph_log, BLEPRPH_LOG_MODULE, __VA_ARGS__)
-
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
 #define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
diff --git a/apps/bleprph_oic/src/gatt_svr.c b/apps/bleprph_oic/src/gatt_svr.c
index c0670768ad..03791d3eba 100644
--- a/apps/bleprph_oic/src/gatt_svr.c
+++ b/apps/bleprph_oic/src/gatt_svr.c
@@ -31,13 +31,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BLEPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BLEPRPH_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -45,7 +45,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BLEPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/bleprph_oic/src/main.c b/apps/bleprph_oic/src/main.c
index e8a1fe3ce1..fa6268459a 100644
--- a/apps/bleprph_oic/src/main.c
+++ b/apps/bleprph_oic/src/main.c
@@ -29,7 +29,6 @@
 
 #include <oic/oc_api.h>
 #include <oic/oc_gatt.h>
-#include <oic/oc_log.h>
 #include <cborattr/cborattr.h>
 
 /* BLE */
@@ -40,10 +39,6 @@
 /* Application-specified header. */
 #include "bleprph.h"
 
-
-/** Log data. */
-struct log bleprph_log;
-
 static int bleprph_gap_event(struct ble_gap_event *event, void *arg);
 
 /**
@@ -52,19 +47,19 @@ static int bleprph_gap_event(struct ble_gap_event *event, void *arg);
 static void
 bleprph_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BLEPRPH_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    BLEPRPH_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    BLEPRPH_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    BLEPRPH_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    BLEPRPH_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
@@ -133,7 +128,7 @@ bleprph_advertise(void)
 #endif
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -144,7 +139,7 @@ bleprph_advertise(void)
     rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                            &adv_params, bleprph_gap_event, NULL);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -173,15 +168,15 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        BLEPRPH_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             bleprph_print_conn_desc(&desc);
         }
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -192,9 +187,9 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLEPRPH_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         bleprph_print_conn_desc(&event->disconnect.conn);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         oc_ble_coap_conn_del(event->disconnect.conn.conn_handle);
 
@@ -204,32 +199,32 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        BLEPRPH_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bleprph_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLEPRPH_LOG(INFO, "advertise complete; reason=%d\n",
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d\n",
                     event->adv_complete.reason);
         bleprph_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BLEPRPH_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bleprph_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLEPRPH_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -241,7 +236,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BLEPRPH_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -270,7 +265,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
 static void
 bleprph_on_reset(int reason)
 {
-    BLEPRPH_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -377,16 +372,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the bleprph log. */
-    log_register("bleprph", &bleprph_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
-    /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the OIC  */
-    log_register("oic", &oc_log, &log_console_handler, NULL, LOG_SYSLEVEL);
     oc_main_init((oc_handler_t *)&omgr_oc_handler);
     oc_ble_coap_gatt_srv_init();
 
diff --git a/apps/bleprph_oic/src/misc.c b/apps/bleprph_oic/src/misc.c
index 8ec785e511..6ed205ec84 100644
--- a/apps/bleprph_oic/src/misc.c
+++ b/apps/bleprph_oic/src/misc.c
@@ -28,7 +28,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BLEPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -38,6 +38,6 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    BLEPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
-                u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+             u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
diff --git a/apps/blesplit/pkg.yml b/apps/blesplit/pkg.yml
index f82c59f999..04234f3547 100644
--- a/apps/blesplit/pkg.yml
+++ b/apps/blesplit/pkg.yml
@@ -25,6 +25,7 @@ pkg.homepage: "http://mynewt.apache.org/"
 pkg.keywords:
 
 pkg.deps:
+    - boot/bootutil
     - boot/split
     - boot/split_app
     - kernel/os
@@ -41,5 +42,6 @@ pkg.deps:
     - sys/console/full
     - sys/id
     - sys/log/full
+    - sys/log/modlog
     - sys/shell
     - sys/stats/full
diff --git a/apps/blesplit/src/blesplit.h b/apps/blesplit/src/blesplit.h
index 8a04e3eda7..6b17c9beec 100644
--- a/apps/blesplit/src/blesplit.h
+++ b/apps/blesplit/src/blesplit.h
@@ -20,7 +20,8 @@
 #ifndef H_BLESPLIT_
 #define H_BLESPLIT_
 
-#include "log/log.h"
+#include "os/mynewt.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -28,15 +29,6 @@ extern "C" {
 struct ble_hs_cfg;
 struct ble_gatt_register_ctxt;
 
-extern struct log blesplit_log;
-
-/* blesplit uses the first "peruser" log module. */
-#define BLESPLIT_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the blesplit module. */
-#define BLESPLIT_LOG(lvl, ...) \
-    LOG_ ## lvl(&blesplit_log, BLESPLIT_LOG_MODULE, __VA_ARGS__)
-
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
 #define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
diff --git a/apps/blesplit/src/main.c b/apps/blesplit/src/main.c
index eda8352a4d..b4d8caa355 100644
--- a/apps/blesplit/src/main.c
+++ b/apps/blesplit/src/main.c
@@ -38,9 +38,6 @@
 /* Application-specified header. */
 #include "blesplit.h"
 
-/** Log data. */
-struct log blesplit_log;
-
 static int blesplit_gap_event(struct ble_gap_event *event, void *arg);
 
 /**
@@ -49,19 +46,19 @@ static int blesplit_gap_event(struct ble_gap_event *event, void *arg);
 static void
 blesplit_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BLESPLIT_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    BLESPLIT_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    BLESPLIT_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    BLESPLIT_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    BLESPLIT_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                  "encrypted=%d authenticated=%d bonded=%d\n",
                  desc->conn_itvl, desc->conn_latency,
                  desc->supervision_timeout,
@@ -87,7 +84,7 @@ blesplit_advertise(void)
     /* Figure out address to use while advertising (no privacy for now) */
     rc = ble_hs_id_infer_auto(0, &own_addr_type);
     if (rc != 0) {
-        BLESPLIT_LOG(ERROR, "error determining address type; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error determining address type; rc=%d\n", rc);
         return;
     }
 
@@ -128,7 +125,7 @@ blesplit_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLESPLIT_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -139,7 +136,7 @@ blesplit_advertise(void)
     rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER,
                            &adv_params, blesplit_gap_event, NULL);
     if (rc != 0) {
-        BLESPLIT_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -168,15 +165,15 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        BLESPLIT_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             blesplit_print_conn_desc(&desc);
         }
-        BLESPLIT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -185,9 +182,9 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLESPLIT_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         blesplit_print_conn_desc(&event->disconnect.conn);
-        BLESPLIT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Connection terminated; resume advertising. */
         blesplit_advertise();
@@ -195,33 +192,33 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        BLESPLIT_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         blesplit_print_conn_desc(&desc);
-        BLESPLIT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLESPLIT_LOG(INFO, "advertise complete; reason=%d\n",
-                     event->adv_complete.reason);
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d\n",
+                    event->adv_complete.reason);
         blesplit_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BLESPLIT_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         blesplit_print_conn_desc(&desc);
-        BLESPLIT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLESPLIT_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -233,7 +230,7 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BLESPLIT_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -262,7 +259,7 @@ blesplit_gap_event(struct ble_gap_event *event, void *arg)
 static void
 blesplit_on_reset(int reason)
 {
-    BLESPLIT_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -294,13 +291,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the blesplit log. */
-    log_register("blesplit", &blesplit_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = blesplit_on_reset;
     ble_hs_cfg.sync_cb = blesplit_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/blesplit/src/misc.c b/apps/blesplit/src/misc.c
index 43f62ae6bd..3c11d916ff 100644
--- a/apps/blesplit/src/misc.c
+++ b/apps/blesplit/src/misc.c
@@ -28,7 +28,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BLESPLIT_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -38,6 +38,6 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    BLESPLIT_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
-                 u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+             u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
diff --git a/apps/bletest/pkg.yml b/apps/bletest/pkg.yml
index 54d87985f3..f32183533e 100644
--- a/apps/bletest/pkg.yml
+++ b/apps/bletest/pkg.yml
@@ -33,5 +33,6 @@ pkg.deps:
     - sys/shell
     - sys/config
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
 pkg.cflags: -DBLETEST
diff --git a/apps/bletest/src/main.c b/apps/bletest/src/main.c
index da76e8b29b..8a5367a9b0 100644
--- a/apps/bletest/src/main.c
+++ b/apps/bletest/src/main.c
@@ -1299,9 +1299,6 @@ main(void)
     g_bletest_cur_peer_addr[5] = 0x08;
 #endif
 
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Set the led pin as an output */
     g_led_pin = LED_BLINK_PIN;
     hal_gpio_init_out(g_led_pin, 1);
diff --git a/apps/bleuart/pkg.yml b/apps/bleuart/pkg.yml
index f8a6d7daa8..ffec104c23 100644
--- a/apps/bleuart/pkg.yml
+++ b/apps/bleuart/pkg.yml
@@ -33,6 +33,7 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - libc/baselibc
     - mgmt/newtmgr
diff --git a/apps/bleuart/src/main.c b/apps/bleuart/src/main.c
index 6817f02ba4..d9b5d88f3b 100644
--- a/apps/bleuart/src/main.c
+++ b/apps/bleuart/src/main.c
@@ -208,8 +208,6 @@ main(void)
     sysinit();
 
     /* Initialize the BLE host. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.sync_cb = bleuart_on_sync;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
 
diff --git a/apps/bsncent/pkg.yml b/apps/bsncent/pkg.yml
index 6ce9462d96..9445bcf551 100644
--- a/apps/bsncent/pkg.yml
+++ b/apps/bsncent/pkg.yml
@@ -32,4 +32,5 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
diff --git a/apps/bsncent/src/bsncent.h b/apps/bsncent/src/bsncent.h
index 5aa742d5af..8363f5e849 100644
--- a/apps/bsncent/src/bsncent.h
+++ b/apps/bsncent/src/bsncent.h
@@ -21,7 +21,7 @@
 #define H_BSNCENT_
 
 #include "os/mynewt.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -32,15 +32,6 @@ struct ble_hs_cfg;
 union ble_store_value;
 union ble_store_key;
 
-extern struct log bsncent_log;
-
-/* bsncent uses the first "peruser" log module. */
-#define BSNCENT_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bsncent module. */
-#define BSNCENT_LOG(lvl, ...) \
-    LOG_ ## lvl(&bsncent_log, BSNCENT_LOG_MODULE, __VA_ARGS__)
-
 #define BSNCENT_SVC_GENDATA                 0x1811
 #define BSNCENT_CHR_SUP_NEW_ALERT_CAT_UUID  0x2A47
 #define BSNCENT_CHR_NEW_ALERT               0x2A46
diff --git a/apps/bsncent/src/main.c b/apps/bsncent/src/main.c
index 029eebca36..bb9d4bdc71 100644
--- a/apps/bsncent/src/main.c
+++ b/apps/bsncent/src/main.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include "os/mynewt.h"
 #include "bsp/bsp.h"
+#include "console/console.h"
 
 /* BLE */
 #include "nimble/ble.h"
@@ -39,8 +40,6 @@
 
 #define BSNCENT_PRINT_RATE      (OS_TICKS_PER_SEC * 10)
 
-struct log bsncent_log;
-
 static uint32_t num_notify_pkts_rx;
 static uint32_t num_notify_bytes_rx;
 
@@ -94,7 +93,7 @@ bsncent_on_subscribe(uint16_t conn_handle,
                      struct ble_gatt_attr *attr,
                      void *arg)
 {
-    BSNCENT_LOG(INFO, "Subscribe complete; status=%d conn_handle=%d "
+    MODLOG_DFLT(INFO, "Subscribe complete; status=%d conn_handle=%d "
                       "attr_handle=%d\n",
                 error->status, conn_handle, attr->handle);
 
@@ -130,7 +129,7 @@ bsncent_subscribe(const struct peer *peer)
         &bsncent_chr_gendata_uuid.u,
         BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16));
     if (dsc == NULL) {
-        BSNCENT_LOG(ERROR, "Error: Peer lacks a CCCD for the generic data "
+        MODLOG_DFLT(ERROR, "Error: Peer lacks a CCCD for the generic data "
                            "characteristic\n");
         goto err;
     }
@@ -140,7 +139,7 @@ bsncent_subscribe(const struct peer *peer)
     rc = ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle,
                               value, sizeof value, bsncent_on_subscribe, NULL);
     if (rc != 0) {
-        BSNCENT_LOG(ERROR, "Error: Failed to subscribe to characteristic; "
+        MODLOG_DFLT(ERROR, "Error: Failed to subscribe to characteristic; "
                            "rc=%d\n", rc);
         goto err;
     }
@@ -161,7 +160,7 @@ bsncent_on_disc_complete(const struct peer *peer, int status, void *arg)
 
     if (status != 0) {
         /* Service discovery failed.  Terminate the connection. */
-        BSNCENT_LOG(ERROR, "Error: Service discovery failed; status=%d "
+        MODLOG_DFLT(ERROR, "Error: Service discovery failed; status=%d "
                            "conn_handle=%d\n", status, peer->conn_handle);
         ble_gap_terminate(peer->conn_handle, BLE_ERR_REM_USER_CONN_TERM);
         return;
@@ -171,7 +170,7 @@ bsncent_on_disc_complete(const struct peer *peer, int status, void *arg)
      * list of services, characteristics, and descriptors that the peer
      * supports.
      */
-    BSNCENT_LOG(ERROR, "Service discovery complete; status=%d "
+    MODLOG_DFLT(ERROR, "Service discovery complete; status=%d "
                        "conn_handle=%d\n", status, peer->conn_handle);
 
     /* Now subscribe to the gendata characterustic. */
@@ -187,7 +186,7 @@ bsncent_on_mtu_exchanged(uint16_t conn_handle,
     int rc;
 
     if (error->status != 0) {
-        BSNCENT_LOG(ERROR, "MTU exchange failed; rc=%d\n", error->status);
+        MODLOG_DFLT(ERROR, "MTU exchange failed; rc=%d\n", error->status);
         ble_gap_terminate(conn_handle, BLE_ERR_REM_USER_CONN_TERM);
         return 0;
     }
@@ -195,7 +194,7 @@ bsncent_on_mtu_exchanged(uint16_t conn_handle,
     /* Perform service discovery. */
     rc = peer_disc_all(conn_handle, bsncent_on_disc_complete, NULL);
     if (rc != 0) {
-        BSNCENT_LOG(ERROR, "Failed to discover services; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "Failed to discover services; rc=%d\n", rc);
         ble_gap_terminate(conn_handle, BLE_ERR_REM_USER_CONN_TERM);
         return 0;
     }
@@ -211,7 +210,7 @@ bsncent_connect(void)
     rc = ble_gap_connect(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                          &ble_gap_conn_params_bsn, bsncent_gap_event, NULL);
     if (rc != 0) {
-        BSNCENT_LOG(ERROR, "Error connecting; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "Error connecting; rc=%d\n", rc);
         if (!((rc == BLE_HS_EALREADY) || (rc == BLE_HS_EBUSY))) {
             /* Only assert if we are not already trying */
             assert(0);
@@ -226,7 +225,7 @@ bsncent_fill_wl(void)
 
     rc = ble_gap_wl_set(bsncent_peer_addrs, bsncent_num_peer_addrs);
     if (rc != 0) {
-        BSNCENT_LOG(ERROR, "Error setting white list; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "Error setting white list; rc=%d\n", rc);
         assert(0);
     }
 }
@@ -303,17 +302,17 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
         /* A new connection was established or a connection attempt failed. */
         if (event->connect.status == 0) {
             /* Connection successfully established. */
-            BSNCENT_LOG(INFO, "Connection established ");
+            MODLOG_DFLT(INFO, "Connection established ");
 
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             print_conn_desc(&desc);
-            BSNCENT_LOG(INFO, "\n");
+            MODLOG_DFLT(INFO, "\n");
 
             /* Remember peer. */
             rc = peer_add(event->connect.conn_handle);
             if (rc != 0) {
-                BSNCENT_LOG(ERROR, "Failed to add peer; rc=%d\n", rc);
+                MODLOG_DFLT(ERROR, "Failed to add peer; rc=%d\n", rc);
                 assert(0);
             }
 
@@ -326,12 +325,12 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
             rc = ble_gattc_exchange_mtu(event->connect.conn_handle,
                                         bsncent_on_mtu_exchanged, NULL);
             if (rc != 0) {
-                BSNCENT_LOG(ERROR, "Failed to exchange MTU; rc=%d\n", rc);
+                MODLOG_DFLT(ERROR, "Failed to exchange MTU; rc=%d\n", rc);
                 return 0;
             }
         } else {
             /* Connection attempt failed; resume connecting. */
-            BSNCENT_LOG(ERROR, "Error: Connection failed; status=%d\n",
+            MODLOG_DFLT(ERROR, "Error: Connection failed; status=%d\n",
                         event->connect.status);
             bsncent_connect();
         }
@@ -340,9 +339,9 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_DISCONNECT:
         /* Connection terminated. */
-        BSNCENT_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         print_conn_desc(&event->disconnect.conn);
-        BSNCENT_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Forget about peer. */
         peer_delete(event->disconnect.conn.conn_handle);
@@ -353,7 +352,7 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BSNCENT_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc);
         assert(rc == 0);
@@ -362,7 +361,7 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_NOTIFY_RX:
         /* Peer sent us a notification or indication. */
-        BSNCENT_LOG(DEBUG, "received %s; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(DEBUG, "received %s; conn_handle=%d attr_handle=%d "
                            "attr_len=%d\n",
                     event->notify_rx.indication ?
                         "indication" :
@@ -378,7 +377,7 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BSNCENT_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -392,7 +391,7 @@ bsncent_gap_event(struct ble_gap_event *event, void *arg)
 static void
 bsncent_on_reset(int reason)
 {
-    BSNCENT_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -426,13 +425,7 @@ main(void)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize the bsncent log. */
-    log_register("bsncent", &bsncent_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Configure the host. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = bsncent_on_reset;
     ble_hs_cfg.sync_cb = bsncent_on_sync;
 
diff --git a/apps/bsncent/src/misc.c b/apps/bsncent/src/misc.c
index 910a3046da..7b00273270 100644
--- a/apps/bsncent/src/misc.c
+++ b/apps/bsncent/src/misc.c
@@ -33,7 +33,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BSNCENT_LOG(DEBUG, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(DEBUG, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -45,7 +45,7 @@ print_mbuf(const struct os_mbuf *om)
     colon = 0;
     while (om != NULL) {
         if (colon) {
-            BSNCENT_LOG(DEBUG, ":");
+            MODLOG_DFLT(DEBUG, ":");
         } else {
             colon = 1;
         }
@@ -72,7 +72,7 @@ print_uuid(const ble_uuid_t *uuid)
 {
     char buf[BLE_UUID_STR_LEN];
 
-    BSNCENT_LOG(DEBUG, "%s", ble_uuid_to_str(uuid, buf));
+    MODLOG_DFLT(DEBUG, "%s", ble_uuid_to_str(uuid, buf));
 }
 
 /**
@@ -81,16 +81,16 @@ print_uuid(const ble_uuid_t *uuid)
 void
 print_conn_desc(const struct ble_gap_conn_desc *desc)
 {
-    BSNCENT_LOG(DEBUG, "handle=%d our_ota_addr_type=%d our_ota_addr=%s ",
+    MODLOG_DFLT(DEBUG, "handle=%d our_ota_addr_type=%d our_ota_addr=%s ",
                 desc->conn_handle, desc->our_ota_addr.type,
                 addr_str(desc->our_ota_addr.val));
-    BSNCENT_LOG(DEBUG, "our_id_addr_type=%d our_id_addr=%s ",
+    MODLOG_DFLT(DEBUG, "our_id_addr_type=%d our_id_addr=%s ",
                 desc->our_id_addr.type, addr_str(desc->our_id_addr.val));
-    BSNCENT_LOG(DEBUG, "peer_ota_addr_type=%d peer_ota_addr=%s ",
+    MODLOG_DFLT(DEBUG, "peer_ota_addr_type=%d peer_ota_addr=%s ",
                 desc->peer_ota_addr.type, addr_str(desc->peer_ota_addr.val));
-    BSNCENT_LOG(DEBUG, "peer_id_addr_type=%d peer_id_addr=%s ",
+    MODLOG_DFLT(DEBUG, "peer_id_addr_type=%d peer_id_addr=%s ",
                 desc->peer_id_addr.type, addr_str(desc->peer_id_addr.val));
-    BSNCENT_LOG(DEBUG, "conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(DEBUG, "conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
@@ -108,102 +108,102 @@ print_adv_fields(const struct ble_hs_adv_fields *fields)
     int i;
 
     if (fields->flags != 0) {
-        BSNCENT_LOG(DEBUG, "    flags=0x%02x\n", fields->flags);
+        MODLOG_DFLT(DEBUG, "    flags=0x%02x\n", fields->flags);
     }
 
     if (fields->uuids16 != NULL) {
-        BSNCENT_LOG(DEBUG, "    uuids16(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids16(%scomplete)=",
                     fields->uuids16_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids16; i++) {
             print_uuid(&fields->uuids16[i].u);
-            BSNCENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uuids32 != NULL) {
-        BSNCENT_LOG(DEBUG, "    uuids32(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids32(%scomplete)=",
                     fields->uuids32_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids32; i++) {
             print_uuid(&fields->uuids32[i].u);
-            BSNCENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uuids128 != NULL) {
-        BSNCENT_LOG(DEBUG, "    uuids128(%scomplete)=",
+        MODLOG_DFLT(DEBUG, "    uuids128(%scomplete)=",
                     fields->uuids128_is_complete ? "" : "in");
         for (i = 0; i < fields->num_uuids128; i++) {
             print_uuid(&fields->uuids128[i].u);
-            BSNCENT_LOG(DEBUG, " ");
+            MODLOG_DFLT(DEBUG, " ");
         }
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->name != NULL) {
         assert(fields->name_len < sizeof s - 1);
         memcpy(s, fields->name, fields->name_len);
         s[fields->name_len] = '\0';
-        BSNCENT_LOG(DEBUG, "    name(%scomplete)=%s\n",
+        MODLOG_DFLT(DEBUG, "    name(%scomplete)=%s\n",
                     fields->name_is_complete ? "" : "in", s);
     }
 
     if (fields->tx_pwr_lvl_is_present) {
-        BSNCENT_LOG(DEBUG, "    tx_pwr_lvl=%d\n", fields->tx_pwr_lvl);
+        MODLOG_DFLT(DEBUG, "    tx_pwr_lvl=%d\n", fields->tx_pwr_lvl);
     }
 
     if (fields->slave_itvl_range != NULL) {
-        BSNCENT_LOG(DEBUG, "    slave_itvl_range=");
+        MODLOG_DFLT(DEBUG, "    slave_itvl_range=");
         print_bytes(fields->slave_itvl_range, BLE_HS_ADV_SLAVE_ITVL_RANGE_LEN);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->svc_data_uuid16 != NULL) {
-        BSNCENT_LOG(DEBUG, "    svc_data_uuid16=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid16=");
         print_bytes(fields->svc_data_uuid16, fields->svc_data_uuid16_len);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->public_tgt_addr != NULL) {
-        BSNCENT_LOG(DEBUG, "    public_tgt_addr=");
+        MODLOG_DFLT(DEBUG, "    public_tgt_addr=");
         u8p = fields->public_tgt_addr;
         for (i = 0; i < fields->num_public_tgt_addrs; i++) {
-            BSNCENT_LOG(DEBUG, "public_tgt_addr=%s ", addr_str(u8p));
+            MODLOG_DFLT(DEBUG, "public_tgt_addr=%s ", addr_str(u8p));
             u8p += BLE_HS_ADV_PUBLIC_TGT_ADDR_ENTRY_LEN;
         }
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->appearance_is_present) {
-        BSNCENT_LOG(DEBUG, "    appearance=0x%04x\n", fields->appearance);
+        MODLOG_DFLT(DEBUG, "    appearance=0x%04x\n", fields->appearance);
     }
 
     if (fields->adv_itvl_is_present) {
-        BSNCENT_LOG(DEBUG, "    adv_itvl=0x%04x\n", fields->adv_itvl);
+        MODLOG_DFLT(DEBUG, "    adv_itvl=0x%04x\n", fields->adv_itvl);
     }
 
     if (fields->svc_data_uuid32 != NULL) {
-        BSNCENT_LOG(DEBUG, "    svc_data_uuid32=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid32=");
         print_bytes(fields->svc_data_uuid32, fields->svc_data_uuid32_len);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->svc_data_uuid128 != NULL) {
-        BSNCENT_LOG(DEBUG, "    svc_data_uuid128=");
+        MODLOG_DFLT(DEBUG, "    svc_data_uuid128=");
         print_bytes(fields->svc_data_uuid128, fields->svc_data_uuid128_len);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->uri != NULL) {
-        BSNCENT_LOG(DEBUG, "    uri=");
+        MODLOG_DFLT(DEBUG, "    uri=");
         print_bytes(fields->uri, fields->uri_len);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 
     if (fields->mfg_data != NULL) {
-        BSNCENT_LOG(DEBUG, "    mfg_data=");
+        MODLOG_DFLT(DEBUG, "    mfg_data=");
         print_bytes(fields->mfg_data, fields->mfg_data_len);
-        BSNCENT_LOG(DEBUG, "\n");
+        MODLOG_DFLT(DEBUG, "\n");
     }
 }
diff --git a/apps/bsnprph/pkg.yml b/apps/bsnprph/pkg.yml
index c0002ceffe..b3034ea1ac 100644
--- a/apps/bsnprph/pkg.yml
+++ b/apps/bsnprph/pkg.yml
@@ -38,6 +38,7 @@ pkg.deps:
     - net/nimble/transport/ram
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/sysinit
     - sys/id
diff --git a/apps/bsnprph/src/bleprph.h b/apps/bsnprph/src/bleprph.h
deleted file mode 100644
index afcbb72e22..0000000000
--- a/apps/bsnprph/src/bleprph.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef H_BLEPRPH_
-#define H_BLEPRPH_
-
-#include "log/log.h"
-#include "nimble/ble.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ble_hs_cfg;
-struct ble_gatt_register_ctxt;
-
-extern struct log bleprph_log;
-
-/* bleprph uses the first "peruser" log module. */
-#define BLEPRPH_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bleprph module. */
-#define BLEPRPH_LOG(lvl, ...) \
-    LOG_ ## lvl(&bleprph_log, BLEPRPH_LOG_MODULE, __VA_ARGS__)
-
-/** GATT server. */
-#define GATT_SVR_SVC_ALERT_UUID               0x1811
-#define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
-#define GATT_SVR_CHR_NEW_ALERT                0x2A46
-#define GATT_SVR_CHR_SUP_UNR_ALERT_CAT_UUID   0x2A48
-#define GATT_SVR_CHR_UNR_ALERT_STAT_UUID      0x2A45
-#define GATT_SVR_CHR_ALERT_NOT_CTRL_PT        0x2A44
-
-void gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg);
-int gatt_svr_init(void);
-
-/** Misc. */
-void print_bytes(const uint8_t *bytes, int len);
-void print_addr(const void *addr);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/apps/bsnprph/src/bsnprph.h b/apps/bsnprph/src/bsnprph.h
index d8e814f245..e305ac70d2 100644
--- a/apps/bsnprph/src/bsnprph.h
+++ b/apps/bsnprph/src/bsnprph.h
@@ -20,7 +20,8 @@
 #ifndef H_BSNPRPH_
 #define H_BSNPRPH_
 
-#include "log/log.h"
+#include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "nimble/ble.h"
 #ifdef __cplusplus
 extern "C" {
@@ -29,15 +30,6 @@ extern "C" {
 struct ble_hs_cfg;
 struct ble_gatt_register_ctxt;
 
-extern struct log bsnprph_log;
-
-/* bsnprph uses the first "peruser" log module. */
-#define BSNPRPH_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bsnprph module. */
-#define BSNPRPH_LOG(lvl, ...) \
-    LOG_ ## lvl(&bsnprph_log, BSNPRPH_LOG_MODULE, __VA_ARGS__)
-
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
 #define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
diff --git a/apps/bsnprph/src/gatt_svr.c b/apps/bsnprph/src/gatt_svr.c
index f8c2af9dba..eefb57bba5 100644
--- a/apps/bsnprph/src/gatt_svr.c
+++ b/apps/bsnprph/src/gatt_svr.c
@@ -87,13 +87,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BSNPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BSNPRPH_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -101,7 +101,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BSNPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/bsnprph/src/main.c b/apps/bsnprph/src/main.c
index a47722b6e7..64c6526ec9 100644
--- a/apps/bsnprph/src/main.c
+++ b/apps/bsnprph/src/main.c
@@ -49,8 +49,6 @@ static const ble_addr_t bsnprph_central_addr = {
     { 0x0a, 0x0b, 0x09, 0x09, 0x09, 0x00 },
 };
 
-struct log bsnprph_log;
-
 /* Sends data to central at 60 Hz. */
 static struct os_callout bsnprph_tx_timer;
 
@@ -65,19 +63,19 @@ static int bsnprph_gap_event(struct ble_gap_event *event, void *arg);
 static void
 bsnprph_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BSNPRPH_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    BSNPRPH_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    BSNPRPH_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    BSNPRPH_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    BSNPRPH_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
                 "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
@@ -136,7 +134,7 @@ bsnprph_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BSNPRPH_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -149,7 +147,7 @@ bsnprph_advertise(void)
                            BLE_HS_FOREVER, &adv_params,
                            bsnprph_gap_event, NULL);
     if (rc != 0) {
-        BSNPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -216,9 +214,9 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        BSNPRPH_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
@@ -226,7 +224,7 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
 
             bsnprph_conn_handle = event->connect.conn_handle;
         }
-        BSNPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -237,9 +235,9 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
     case BLE_GAP_EVENT_DISCONNECT:
         os_callout_stop(&bsnprph_tx_timer);
 
-        BSNPRPH_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         bsnprph_print_conn_desc(&event->disconnect.conn);
-        BSNPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Connection terminated; resume advertising. */
         bsnprph_advertise();
@@ -247,32 +245,32 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
         os_callout_stop(&bsnprph_tx_timer);
-        BSNPRPH_LOG(INFO, "adv complete\n");
+        MODLOG_DFLT(INFO, "adv complete\n");
         bsnprph_advertise();
         return 0;
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        BSNPRPH_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bsnprph_print_conn_desc(&desc);
-        BSNPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BSNPRPH_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         bsnprph_print_conn_desc(&desc);
-        BSNPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BSNPRPH_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -288,7 +286,7 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BSNPRPH_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -301,7 +299,7 @@ bsnprph_gap_event(struct ble_gap_event *event, void *arg)
 static void
 bsnprph_on_reset(int reason)
 {
-    BSNPRPH_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -330,13 +328,7 @@ main(void)
     /* Set initial BLE device address. */
     memcpy(g_dev_addr, bsnprph_prph_public_addr, 6);
 
-    /* Initialize the bsnprph log. */
-    log_register("bsnprph", &bsnprph_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = bsnprph_on_reset;
     ble_hs_cfg.sync_cb = bsnprph_on_sync;
     ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb;
diff --git a/apps/bsnprph/src/misc.c b/apps/bsnprph/src/misc.c
index 72dc813a7c..6b2e58432c 100644
--- a/apps/bsnprph/src/misc.c
+++ b/apps/bsnprph/src/misc.c
@@ -28,7 +28,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BSNPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -38,6 +38,6 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    BSNPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
-                u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+             u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
diff --git a/apps/btshell/pkg.yml b/apps/btshell/pkg.yml
index 2e1084ce6c..f00ff74540 100644
--- a/apps/btshell/pkg.yml
+++ b/apps/btshell/pkg.yml
@@ -30,6 +30,7 @@ pkg.deps:
     - net/nimble/host/store/ram
     - net/nimble/transport
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - sys/console/full
     - sys/shell
diff --git a/apps/btshell/src/btshell.h b/apps/btshell/src/btshell.h
index 8b181f22d6..0d3a50aa23 100644
--- a/apps/btshell/src/btshell.h
+++ b/apps/btshell/src/btshell.h
@@ -24,7 +24,7 @@
 #include "os/mynewt.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 
 #include "host/ble_gatt.h"
 #include "host/ble_gap.h"
@@ -89,7 +89,6 @@ struct btshell_scan_opts {
 extern struct btshell_conn btshell_conns[MYNEWT_VAL(BLE_MAX_CONNECTIONS)];
 extern int btshell_num_conns;
 
-extern struct log btshell_log;
 int btshell_exchange_mtu(uint16_t conn_handle);
 int btshell_disc_svcs(uint16_t conn_handle);
 int btshell_disc_svc_by_uuid(uint16_t conn_handle, const ble_uuid_t *uuid);
@@ -165,9 +164,6 @@ int btshell_l2cap_create_srv(uint16_t psm, int accept_response);
 int btshell_l2cap_connect(uint16_t conn, uint16_t psm);
 int btshell_l2cap_disconnect(uint16_t conn, uint16_t idx);
 int btshell_l2cap_send(uint16_t conn, uint16_t idx, uint16_t bytes);
-#define BTSHELL_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-#define BTSHELL_LOG(lvl, ...) \
-    LOG_ ## lvl(&btshell_log, BTSHELL_LOG_MODULE, __VA_ARGS__)
 
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
diff --git a/apps/btshell/src/gatt_svr.c b/apps/btshell/src/gatt_svr.c
index 792a41772c..ba52158581 100644
--- a/apps/btshell/src/gatt_svr.c
+++ b/apps/btshell/src/gatt_svr.c
@@ -545,13 +545,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BTSHELL_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BTSHELL_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -559,7 +559,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BTSHELL_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c
index 103668270a..a794fb87a5 100644
--- a/apps/btshell/src/main.c
+++ b/apps/btshell/src/main.c
@@ -74,8 +74,6 @@
 #define PTR_TO_INT(x)     (int) ((intptr_t)(x))
 #endif
 
-struct log btshell_log;
-
 bssnz_t struct btshell_conn btshell_conns[MYNEWT_VAL(BLE_MAX_CONNECTIONS)];
 int btshell_num_conns;
 
@@ -390,7 +388,7 @@ btshell_svc_add(uint16_t conn_handle, const struct ble_gatt_svc *gatt_svc)
 
     conn = btshell_conn_find(conn_handle);
     if (conn == NULL) {
-        BTSHELL_LOG(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
+        MODLOG_DFLT(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
                            "HANDLE=%d\n",
                     conn_handle);
         return NULL;
@@ -404,7 +402,7 @@ btshell_svc_add(uint16_t conn_handle, const struct ble_gatt_svc *gatt_svc)
 
     svc = os_memblock_get(&btshell_svc_pool);
     if (svc == NULL) {
-        BTSHELL_LOG(DEBUG, "OOM WHILE DISCOVERING SERVICE\n");
+        MODLOG_DFLT(DEBUG, "OOM WHILE DISCOVERING SERVICE\n");
         return NULL;
     }
     memset(svc, 0, sizeof *svc);
@@ -474,7 +472,7 @@ btshell_chr_add(uint16_t conn_handle,  uint16_t svc_start_handle,
 
     conn = btshell_conn_find(conn_handle);
     if (conn == NULL) {
-        BTSHELL_LOG(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
+        MODLOG_DFLT(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
                            "HANDLE=%d\n",
                     conn_handle);
         return NULL;
@@ -482,7 +480,7 @@ btshell_chr_add(uint16_t conn_handle,  uint16_t svc_start_handle,
 
     svc = btshell_svc_find(conn, svc_start_handle, NULL);
     if (svc == NULL) {
-        BTSHELL_LOG(DEBUG, "CAN'T FIND SERVICE FOR DISCOVERED CHR; HANDLE=%d\n",
+        MODLOG_DFLT(DEBUG, "CAN'T FIND SERVICE FOR DISCOVERED CHR; HANDLE=%d\n",
                     conn_handle);
         return NULL;
     }
@@ -495,7 +493,7 @@ btshell_chr_add(uint16_t conn_handle,  uint16_t svc_start_handle,
 
     chr = os_memblock_get(&btshell_chr_pool);
     if (chr == NULL) {
-        BTSHELL_LOG(DEBUG, "OOM WHILE DISCOVERING CHARACTERISTIC\n");
+        MODLOG_DFLT(DEBUG, "OOM WHILE DISCOVERING CHARACTERISTIC\n");
         return NULL;
     }
     memset(chr, 0, sizeof *chr);
@@ -565,7 +563,7 @@ btshell_dsc_add(uint16_t conn_handle, uint16_t chr_val_handle,
 
     conn = btshell_conn_find(conn_handle);
     if (conn == NULL) {
-        BTSHELL_LOG(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
+        MODLOG_DFLT(DEBUG, "RECEIVED SERVICE FOR UNKNOWN CONNECTION; "
                            "HANDLE=%d\n",
                     conn_handle);
         return NULL;
@@ -573,14 +571,14 @@ btshell_dsc_add(uint16_t conn_handle, uint16_t chr_val_handle,
 
     svc = btshell_svc_find_range(conn, chr_val_handle);
     if (svc == NULL) {
-        BTSHELL_LOG(DEBUG, "CAN'T FIND SERVICE FOR DISCOVERED DSC; HANDLE=%d\n",
+        MODLOG_DFLT(DEBUG, "CAN'T FIND SERVICE FOR DISCOVERED DSC; HANDLE=%d\n",
                     conn_handle);
         return NULL;
     }
 
     chr = btshell_chr_find(svc, chr_val_handle, NULL);
     if (chr == NULL) {
-        BTSHELL_LOG(DEBUG, "CAN'T FIND CHARACTERISTIC FOR DISCOVERED DSC; "
+        MODLOG_DFLT(DEBUG, "CAN'T FIND CHARACTERISTIC FOR DISCOVERED DSC; "
                            "HANDLE=%d\n",
                     conn_handle);
         return NULL;
@@ -689,7 +687,7 @@ btshell_disc_full_dscs(uint16_t conn_handle)
 
     conn = btshell_conn_find(conn_handle);
     if (conn == NULL) {
-        BTSHELL_LOG(DEBUG, "Failed to discover descriptors for conn=%d; "
+        MODLOG_DFLT(DEBUG, "Failed to discover descriptors for conn=%d; "
                            "not connected\n", conn_handle);
         btshell_full_disc_complete(BLE_HS_ENOTCONN);
         return;
@@ -727,7 +725,7 @@ btshell_disc_full_chrs(uint16_t conn_handle)
 
     conn = btshell_conn_find(conn_handle);
     if (conn == NULL) {
-        BTSHELL_LOG(DEBUG, "Failed to discover characteristics for conn=%d; "
+        MODLOG_DFLT(DEBUG, "Failed to discover characteristics for conn=%d; "
                            "not connected\n", conn_handle);
         btshell_full_disc_complete(BLE_HS_ENOTCONN);
         return;
@@ -2080,13 +2078,7 @@ main(int argc, char **argv)
     assert(rc == 0);
 #endif
 
-    /* Initialize the logging system. */
-    log_register("btshell", &btshell_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = btshell_on_reset;
     ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb;
     ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
diff --git a/apps/iptest/src/main.c b/apps/iptest/src/main.c
index 3210b496ef..f56fe5e28b 100644
--- a/apps/iptest/src/main.c
+++ b/apps/iptest/src/main.c
@@ -24,7 +24,6 @@
 #include <hal/hal_flash.h>
 #include <console/console.h>
 
-#include <log/log.h>
 #include <config/config.h>
 #include <hal/hal_system.h>
 
@@ -41,7 +40,6 @@
 
 #if MYNEWT_VAL(BUILD_WITH_OIC)
 #include <oic/oc_api.h>
-#include <oic/oc_log.h>
 #include <cborattr/cborattr.h>
 #endif
 
@@ -49,13 +47,6 @@
 #include <mcu/mcu_sim.h>
 #endif
 
-static struct log my_log;
-
-#define MAX_CBMEM_BUF 2048
-
-static uint32_t cbmem_buf[MAX_CBMEM_BUF];
-static struct cbmem cbmem;
-
 static int net_cli(int argc, char **argv);
 struct shell_cmd net_test_cmd = {
     .sc_cmd = "net",
@@ -421,9 +412,6 @@ main(int argc, char **argv)
 
     console_printf("iptest\n");
 
-    cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
-    log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
-
     shell_cmd_register(&net_test_cmd);
 
     /*
diff --git a/apps/ocf_sample/pkg.yml b/apps/ocf_sample/pkg.yml
index f43e7afde9..b9dba9271e 100644
--- a/apps/ocf_sample/pkg.yml
+++ b/apps/ocf_sample/pkg.yml
@@ -30,6 +30,7 @@ pkg.deps:
     - encoding/cborattr
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
 
 pkg.deps.OC_TRANSPORT_SERIAL:
diff --git a/apps/ocf_sample/src/ocf_ble.c b/apps/ocf_sample/src/ocf_ble.c
index 1a4ed9c955..2e6b23b1e0 100644
--- a/apps/ocf_sample/src/ocf_ble.c
+++ b/apps/ocf_sample/src/ocf_ble.c
@@ -24,7 +24,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "log/log.h"
+#include "modlog/modlog.h"
 
 #include "oic/oc_gatt.h"
 
@@ -33,15 +33,6 @@
 #include "host/ble_hs.h"
 #include "services/gap/ble_svc_gap.h"
 
-struct log ocf_ble_log;
-
-/* ocf_ble uses the first "peruser" log module. */
-#define OCF_BLE_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the ocf_ble module. */
-#define OCF_BLE_LOG(lvl, ...) \
-    LOG_ ## lvl(&ocf_ble_log, OCF_BLE_LOG_MODULE, __VA_ARGS__)
-
 static int ocf_ble_gap_event(struct ble_gap_event *event, void *arg);
 
 /**
@@ -53,7 +44,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        OCF_BLE_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -63,7 +54,7 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    OCF_BLE_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
                 u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
 
@@ -73,20 +64,20 @@ print_addr(const void *addr)
 static void
 ocf_ble_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    OCF_BLE_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    OCF_BLE_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    OCF_BLE_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    OCF_BLE_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    OCF_BLE_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
-                "encrypted=%d authenticated=%d bonded=%d\n",
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+                      "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
                 desc->sec_state.encrypted,
@@ -137,7 +128,7 @@ ocf_ble_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        OCF_BLE_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -148,7 +139,7 @@ ocf_ble_advertise(void)
     rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                            &adv_params, ocf_ble_gap_event, NULL);
     if (rc != 0) {
-        OCF_BLE_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -184,15 +175,15 @@ ocf_ble_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        OCF_BLE_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             ocf_ble_print_conn_desc(&desc);
         }
-        OCF_BLE_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -201,9 +192,9 @@ ocf_ble_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        OCF_BLE_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         ocf_ble_print_conn_desc(&event->disconnect.conn);
-        OCF_BLE_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Connection terminated; resume advertising. */
         ocf_ble_advertise();
@@ -211,32 +202,32 @@ ocf_ble_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        OCF_BLE_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         ocf_ble_print_conn_desc(&desc);
-        OCF_BLE_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        OCF_BLE_LOG(INFO, "advertise complete; reason=%d\n",
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d\n",
                     event->adv_complete.reason);
         ocf_ble_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        OCF_BLE_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         ocf_ble_print_conn_desc(&desc);
-        OCF_BLE_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        OCF_BLE_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -248,7 +239,7 @@ ocf_ble_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        OCF_BLE_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -263,16 +254,9 @@ static const uint8_t ocf_ble_addr[6] = {1,2,3,4,5,6};
 void
 ocf_ble_init(void)
 {
-    /* Initialize the ocf_ble log. */
-    log_register("ocf_ble", &ocf_ble_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     memcpy(g_dev_addr, ocf_ble_addr, sizeof(g_dev_addr));
 
     /* Initialize the BLE host. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     ble_hs_cfg.sync_cb = ocf_ble_on_sync;
 }
 
diff --git a/apps/sensors_test/pkg.yml b/apps/sensors_test/pkg.yml
index d4815200f7..259aa163bc 100644
--- a/apps/sensors_test/pkg.yml
+++ b/apps/sensors_test/pkg.yml
@@ -30,6 +30,7 @@ pkg.deps:
     - boot/bootutil
     - sys/console/full
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - hw/sensor/creator
     - sys/reboot
diff --git a/apps/sensors_test/src/bleprph.h b/apps/sensors_test/src/bleprph.h
index 2e3f024737..cacca932df 100644
--- a/apps/sensors_test/src/bleprph.h
+++ b/apps/sensors_test/src/bleprph.h
@@ -20,7 +20,7 @@
 #ifndef H_BLEPRPH_
 #define H_BLEPRPH_
 
-#include "log/log.h"
+#include "modlog/modlog.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -28,15 +28,6 @@ extern "C" {
 struct ble_hs_cfg;
 struct ble_gatt_register_ctxt;
 
-extern struct log bleprph_log;
-
-/* bleprph uses the first "peruser" log module. */
-#define BLEPRPH_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the bleprph module. */
-#define BLEPRPH_LOG(lvl, ...) \
-    LOG_ ## lvl(&bleprph_log, BLEPRPH_LOG_MODULE, __VA_ARGS__)
-
 /** GATT server. */
 #define GATT_SVR_SVC_ALERT_UUID               0x1811
 #define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID   0x2A47
diff --git a/apps/sensors_test/src/gatt_svr.c b/apps/sensors_test/src/gatt_svr.c
index db6e61b0be..130e4df59a 100644
--- a/apps/sensors_test/src/gatt_svr.c
+++ b/apps/sensors_test/src/gatt_svr.c
@@ -35,13 +35,13 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
 
     switch (ctxt->op) {
     case BLE_GATT_REGISTER_OP_SVC:
-        BLEPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registered service %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf),
                     ctxt->svc.handle);
         break;
 
     case BLE_GATT_REGISTER_OP_CHR:
-        BLEPRPH_LOG(DEBUG, "registering characteristic %s with "
+        MODLOG_DFLT(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
                     ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf),
                     ctxt->chr.def_handle,
@@ -49,7 +49,7 @@ gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg)
         break;
 
     case BLE_GATT_REGISTER_OP_DSC:
-        BLEPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d\n",
+        MODLOG_DFLT(DEBUG, "registering descriptor %s with handle=%d\n",
                     ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf),
                     ctxt->dsc.handle);
         break;
diff --git a/apps/sensors_test/src/main.c b/apps/sensors_test/src/main.c
index 1080c75e06..7783d7472d 100644
--- a/apps/sensors_test/src/main.c
+++ b/apps/sensors_test/src/main.c
@@ -91,9 +91,6 @@ static const oc_handler_t sensor_oic_handler = {
 static int sensor_oic_gap_event(struct ble_gap_event *event, void *arg);
 #endif
 
-/** Log data. */
-struct log bleprph_log;
-
 #endif
 
 #ifdef ARCH_sim
@@ -127,20 +124,20 @@ static int g_led_pin;
 static void
 sensor_oic_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    BLEPRPH_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     print_addr(desc->our_ota_addr.val);
-    BLEPRPH_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     print_addr(desc->our_id_addr.val);
-    BLEPRPH_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     print_addr(desc->peer_ota_addr.val);
-    BLEPRPH_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     print_addr(desc->peer_id_addr.val);
-    BLEPRPH_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
-                "encrypted=%d authenticated=%d bonded=%d\n",
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+                      "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
                 desc->sec_state.encrypted,
@@ -200,7 +197,7 @@ sensor_oic_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -211,7 +208,7 @@ sensor_oic_advertise(void)
     rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                            &adv_params, sensor_oic_gap_event, NULL);
     if (rc != 0) {
-        BLEPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -220,7 +217,7 @@ sensor_oic_advertise(void)
 static void
 sensor_oic_on_reset(int reason)
 {
-    BLEPRPH_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -254,15 +251,15 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        BLEPRPH_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             sensor_oic_print_conn_desc(&desc);
         }
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -273,9 +270,9 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        BLEPRPH_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         sensor_oic_print_conn_desc(&event->disconnect.conn);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         oc_ble_coap_conn_del(event->disconnect.conn.conn_handle);
 
@@ -285,38 +282,38 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        BLEPRPH_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         sensor_oic_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
 
     case BLE_GAP_EVENT_DISC_COMPLETE:
-        BLEPRPH_LOG(INFO, "discovery complete; reason=%d\n",
+        MODLOG_DFLT(INFO, "discovery complete; reason=%d\n",
                     event->disc_complete.reason);
         return 0;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        BLEPRPH_LOG(INFO, "advertise complete; reason=%d\n",
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d\n",
                     event->adv_complete.reason);
         sensor_oic_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        BLEPRPH_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         sensor_oic_print_conn_desc(&desc);
-        BLEPRPH_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        BLEPRPH_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -328,7 +325,7 @@ sensor_oic_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        BLEPRPH_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -487,25 +484,6 @@ sensor_ble_oic_server_init(void)
 #endif
 }
 
-static void
-ble_oic_log_init(void)
-{
-#if MYNEWT_VAL(SENSOR_BLE)
-    /* Initialize the bleprph log. */
-    log_register("bleprph", &bleprph_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
-    /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-#endif
-
-#if MYNEWT_VAL(SENSOR_OIC)
-    /* Initialize the OIC  */
-    log_register("oic", &oc_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-#endif
-}
-
 /**
  * main
  *
@@ -525,9 +503,6 @@ main(int argc, char **argv)
     /* Initialize OS */
     sysinit();
 
-    /* Initialize BLE and OIC logs */
-    ble_oic_log_init();
-
     /* Initialize tasks */
     init_tasks();
 
diff --git a/apps/sensors_test/src/misc.c b/apps/sensors_test/src/misc.c
index 8ec785e511..6ed205ec84 100644
--- a/apps/sensors_test/src/misc.c
+++ b/apps/sensors_test/src/misc.c
@@ -28,7 +28,7 @@ print_bytes(const uint8_t *bytes, int len)
     int i;
 
     for (i = 0; i < len; i++) {
-        BLEPRPH_LOG(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
+        MODLOG_DFLT(INFO, "%s0x%02x", i != 0 ? ":" : "", bytes[i]);
     }
 }
 
@@ -38,6 +38,6 @@ print_addr(const void *addr)
     const uint8_t *u8p;
 
     u8p = addr;
-    BLEPRPH_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
-                u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+             u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
diff --git a/apps/slinky/pkg.yml b/apps/slinky/pkg.yml
index 4e4c7d8914..77850fce57 100644
--- a/apps/slinky/pkg.yml
+++ b/apps/slinky/pkg.yml
@@ -36,6 +36,7 @@ pkg.deps:
     - sys/console/full
     - sys/id
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - boot/split
 
diff --git a/apps/slinky/src/main.c b/apps/slinky/src/main.c
index a33cafc560..3cf9716ca2 100644
--- a/apps/slinky/src/main.c
+++ b/apps/slinky/src/main.c
@@ -39,6 +39,7 @@
 #include <string.h>
 #include <reboot/log_reboot.h>
 #include <id/id.h>
+#include "modlog/modlog.h"
 
 #ifdef ARCH_sim
 #include <mcu/mcu_sim.h>
@@ -172,8 +173,8 @@ task1_handler(void *arg)
         /* Toggle the LED */
         prev_pin_state = hal_gpio_read(g_led_pin);
         curr_pin_state = hal_gpio_toggle(g_led_pin);
-        LOG_INFO(&my_log, LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
-            prev_pin_state, curr_pin_state);
+        MODLOG_DFLT(INFO, "GPIO toggle from %u to %u",
+                    prev_pin_state, curr_pin_state);
         STATS_INC(g_stats_gpio_toggle, toggles);
 
         /* Release semaphore to task 2 */
@@ -254,6 +255,10 @@ main(int argc, char **argv)
     cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
     log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
 
+    /* Point the default module at the cbmem log just registered. */
+    rc = modlog_register(LOG_MODULE_DEFAULT, &my_log, LOG_LEVEL_DEBUG, NULL);
+    assert(rc == 0);
+
     stats_init(STATS_HDR(g_stats_gpio_toggle),
                STATS_SIZE_INIT_PARMS(g_stats_gpio_toggle, STATS_SIZE_32),
                STATS_NAME_INIT_PARMS(gpio_stats));
diff --git a/apps/slinky/syscfg.yml b/apps/slinky/syscfg.yml
index 7438a81790..5661efee41 100644
--- a/apps/slinky/syscfg.yml
+++ b/apps/slinky/syscfg.yml
@@ -17,6 +17,10 @@
 #
 
 # Package: apps/slinky
+syscfg.defs:
+    SLINKY_LOG_MODULE_GPIO:
+        description: The log module to use for slinky GPIO messages.
+        value: 64
 
 syscfg.vals:
     # Enable the shell task.
diff --git a/apps/slinky_oic/pkg.yml b/apps/slinky_oic/pkg.yml
index 74364c4fd2..645115f3b4 100644
--- a/apps/slinky_oic/pkg.yml
+++ b/apps/slinky_oic/pkg.yml
@@ -34,6 +34,7 @@ pkg.deps:
     - sys/console/full
     - sys/id
     - sys/log/full
+    - sys/log/modlog
     - sys/stats/full
     - boot/split
 
diff --git a/apps/slinky_oic/src/main.c b/apps/slinky_oic/src/main.c
index c5854a1569..25d621429f 100644
--- a/apps/slinky_oic/src/main.c
+++ b/apps/slinky_oic/src/main.c
@@ -168,8 +168,8 @@ task1_handler(void *arg)
         /* Toggle the LED */
         prev_pin_state = hal_gpio_read(g_led_pin);
         curr_pin_state = hal_gpio_toggle(g_led_pin);
-        LOG_INFO(&my_log, LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
-            prev_pin_state, curr_pin_state);
+        MODLOG_DFLT(INFO, "GPIO toggle from %u to %u",
+                    prev_pin_state, curr_pin_state);
         STATS_INC(g_stats_gpio_toggle, toggles);
 
         /* Release semaphore to task 2 */
@@ -268,8 +268,9 @@ main(int argc, char **argv)
     cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
     log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
 
-    /* Initialize the OIC  */
-    log_register("oic", &oc_log, &log_console_handler, NULL, LOG_SYSLEVEL);
+    /* Point the default module at the cbmem log just registered. */
+    rc = modlog_register(LOG_MODULE_DEFAULT, &my_log, LOG_LEVEL_DEBUG, NULL);
+    assert(rc == 0);
 
     stats_init(STATS_HDR(g_stats_gpio_toggle),
                STATS_SIZE_INIT_PARMS(g_stats_gpio_toggle, STATS_SIZE_32),
diff --git a/apps/splitty/pkg.yml b/apps/splitty/pkg.yml
index 68e4e1e71c..326c9deaad 100644
--- a/apps/splitty/pkg.yml
+++ b/apps/splitty/pkg.yml
@@ -36,5 +36,6 @@ pkg.deps:
     - sys/console/full
     - sys/id
     - sys/log/full
+    - sys/log/modlog
     - sys/shell
     - sys/stats/full
diff --git a/apps/splitty/src/main.c b/apps/splitty/src/main.c
index 674787b613..04eab297e4 100644
--- a/apps/splitty/src/main.c
+++ b/apps/splitty/src/main.c
@@ -25,7 +25,7 @@
 #include <hal/hal_flash.h>
 #include <console/console.h>
 #include <shell/shell.h>
-#include <log/log.h>
+#include <modlog/modlog.h>
 #include <stats/stats.h>
 #include <config/config.h>
 #include <flash_map/flash_map.h>
@@ -107,8 +107,8 @@ task1_handler(void *arg)
         /* Toggle the LED */
         prev_pin_state = hal_gpio_read(g_led_pin);
         curr_pin_state = hal_gpio_toggle(g_led_pin);
-        LOG_INFO(&my_log, LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
-            prev_pin_state, curr_pin_state);
+        MODLOG_INFO(LOG_MODULE_DEFAULT, "GPIO toggle from %u to %u",
+                    prev_pin_state, curr_pin_state);
         STATS_INC(g_stats_gpio_toggle, toggles);
 
         /* Release semaphore to task 2 */
@@ -187,6 +187,9 @@ main(int argc, char **argv)
     cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
     log_register("log", &my_log, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
 
+    rc = modlog_register(LOG_MODULE_DEFAULT, &my_log, LOG_LEVEL_DEBUG, NULL);
+    assert(rc == 0);
+
     stats_init(STATS_HDR(g_stats_gpio_toggle),
                STATS_SIZE_INIT_PARMS(g_stats_gpio_toggle, STATS_SIZE_32),
                STATS_NAME_INIT_PARMS(gpio_stats));
diff --git a/apps/splitty/syscfg.yml b/apps/splitty/syscfg.yml
index 7ff1dfb6a6..cd2ece79be 100644
--- a/apps/splitty/syscfg.yml
+++ b/apps/splitty/syscfg.yml
@@ -26,4 +26,5 @@ syscfg.vals:
     STATS_NAMES: 1
 
     # Log reboot messages to a flash circular buffer.
+    LOG_FCB: 1
     REBOOT_LOG_FCB: 1
diff --git a/apps/testbench/pkg.yml b/apps/testbench/pkg.yml
index db39cde2e8..9810c42745 100644
--- a/apps/testbench/pkg.yml
+++ b/apps/testbench/pkg.yml
@@ -38,6 +38,7 @@ pkg.deps:
     - "@apache-mynewt-core/sys/flash_map/test"
     - "@apache-mynewt-core/sys/id"
     - "@apache-mynewt-core/sys/log/full"
+    - "@apache-mynewt-core/sys/log/modlog"
     - "@apache-mynewt-core/sys/stats/full"
     - "@apache-mynewt-core/test/crash_test"
     - "@apache-mynewt-core/test/runtest"
diff --git a/apps/testbench/src/tbb.c b/apps/testbench/src/tbb.c
index aa3279c1af..a0633aadef 100644
--- a/apps/testbench/src/tbb.c
+++ b/apps/testbench/src/tbb.c
@@ -34,6 +34,7 @@
 #include "hal/hal_system.h"
 #include "config/config.h"
 #include "split/split.h"
+#include "modlog/modlog.h"
 
 /* BLE */
 #include "nimble/ble.h"
@@ -46,23 +47,14 @@
 
 static int tbb_gap_event(struct ble_gap_event *event, void *arg);
 
-static struct log tbb_log;
-
-/* tbb uses the first "peruser" log module. */
-#define TBB_LOG_MODULE  (LOG_MODULE_PERUSER + 0)
-
-/* Convenience macro for logging to the tbb module. */
-#define TBB_LOG(lvl, ...) \
-    LOG_ ## lvl(&tbb_log, TBB_LOG_MODULE, __VA_ARGS__)
-
 void
 tbb_print_addr(const void *addr)
 {
     const uint8_t *u8p;
 
     u8p = addr;
-    TBB_LOG(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
-            u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
+    MODLOG_DFLT(INFO, "%02x:%02x:%02x:%02x:%02x:%02x",
+                u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]);
 }
 
 /**
@@ -71,20 +63,20 @@ tbb_print_addr(const void *addr)
 static void
 tbb_print_conn_desc(struct ble_gap_conn_desc *desc)
 {
-    TBB_LOG(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
+    MODLOG_DFLT(INFO, "handle=%d our_ota_addr_type=%d our_ota_addr=",
                 desc->conn_handle, desc->our_ota_addr.type);
     tbb_print_addr(desc->our_ota_addr.val);
-    TBB_LOG(INFO, " our_id_addr_type=%d our_id_addr=",
+    MODLOG_DFLT(INFO, " our_id_addr_type=%d our_id_addr=",
                 desc->our_id_addr.type);
     tbb_print_addr(desc->our_id_addr.val);
-    TBB_LOG(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
+    MODLOG_DFLT(INFO, " peer_ota_addr_type=%d peer_ota_addr=",
                 desc->peer_ota_addr.type);
     tbb_print_addr(desc->peer_ota_addr.val);
-    TBB_LOG(INFO, " peer_id_addr_type=%d peer_id_addr=",
+    MODLOG_DFLT(INFO, " peer_id_addr_type=%d peer_id_addr=",
                 desc->peer_id_addr.type);
     tbb_print_addr(desc->peer_id_addr.val);
-    TBB_LOG(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
-                "encrypted=%d authenticated=%d bonded=%d\n",
+    MODLOG_DFLT(INFO, " conn_itvl=%d conn_latency=%d supervision_timeout=%d "
+                      "encrypted=%d authenticated=%d bonded=%d\n",
                 desc->conn_itvl, desc->conn_latency,
                 desc->supervision_timeout,
                 desc->sec_state.encrypted,
@@ -142,7 +134,7 @@ tbb_advertise(void)
 
     rc = ble_gap_adv_set_fields(&fields);
     if (rc != 0) {
-        TBB_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error setting advertisement data; rc=%d\n", rc);
         return;
     }
 
@@ -153,7 +145,7 @@ tbb_advertise(void)
     rc = ble_gap_adv_start(BLE_OWN_ADDR_PUBLIC, NULL, BLE_HS_FOREVER,
                            &adv_params, tbb_gap_event, NULL);
     if (rc != 0) {
-        TBB_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+        MODLOG_DFLT(ERROR, "error enabling advertisement; rc=%d\n", rc);
         return;
     }
 }
@@ -182,15 +174,15 @@ tbb_gap_event(struct ble_gap_event *event, void *arg)
     switch (event->type) {
     case BLE_GAP_EVENT_CONNECT:
         /* A new connection was established or a connection attempt failed. */
-        TBB_LOG(INFO, "connection %s; status=%d ",
-                       event->connect.status == 0 ? "established" : "failed",
-                       event->connect.status);
+        MODLOG_DFLT(INFO, "connection %s; status=%d ",
+                    event->connect.status == 0 ? "established" : "failed",
+                    event->connect.status);
         if (event->connect.status == 0) {
             rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
             assert(rc == 0);
             tbb_print_conn_desc(&desc);
         }
-        TBB_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising. */
@@ -199,9 +191,9 @@ tbb_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_DISCONNECT:
-        TBB_LOG(INFO, "disconnect; reason=%d ", event->disconnect.reason);
+        MODLOG_DFLT(INFO, "disconnect; reason=%d ", event->disconnect.reason);
         tbb_print_conn_desc(&event->disconnect.conn);
-        TBB_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
 
         /* Connection terminated; resume advertising. */
         tbb_advertise();
@@ -209,32 +201,32 @@ tbb_gap_event(struct ble_gap_event *event, void *arg)
 
     case BLE_GAP_EVENT_CONN_UPDATE:
         /* The central has updated the connection parameters. */
-        TBB_LOG(INFO, "connection updated; status=%d ",
+        MODLOG_DFLT(INFO, "connection updated; status=%d ",
                     event->conn_update.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         tbb_print_conn_desc(&desc);
-        TBB_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_ADV_COMPLETE:
-        TBB_LOG(INFO, "advertise complete; reason=%d\n",
-                event->adv_complete.reason);
+        MODLOG_DFLT(INFO, "advertise complete; reason=%d\n",
+                    event->adv_complete.reason);
         tbb_advertise();
         return 0;
 
     case BLE_GAP_EVENT_ENC_CHANGE:
         /* Encryption has been enabled or disabled for this connection. */
-        TBB_LOG(INFO, "encryption change event; status=%d ",
+        MODLOG_DFLT(INFO, "encryption change event; status=%d ",
                     event->enc_change.status);
         rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
         assert(rc == 0);
         tbb_print_conn_desc(&desc);
-        TBB_LOG(INFO, "\n");
+        MODLOG_DFLT(INFO, "\n");
         return 0;
 
     case BLE_GAP_EVENT_SUBSCRIBE:
-        TBB_LOG(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
+        MODLOG_DFLT(INFO, "subscribe event; conn_handle=%d attr_handle=%d "
                           "reason=%d prevn=%d curn=%d previ=%d curi=%d\n",
                     event->subscribe.conn_handle,
                     event->subscribe.attr_handle,
@@ -246,7 +238,7 @@ tbb_gap_event(struct ble_gap_event *event, void *arg)
         return 0;
 
     case BLE_GAP_EVENT_MTU:
-        TBB_LOG(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
+        MODLOG_DFLT(INFO, "mtu update event; conn_handle=%d cid=%d mtu=%d\n",
                     event->mtu.conn_handle,
                     event->mtu.channel_id,
                     event->mtu.value);
@@ -259,7 +251,7 @@ tbb_gap_event(struct ble_gap_event *event, void *arg)
 static void
 tbb_on_reset(int reason)
 {
-    TBB_LOG(ERROR, "Resetting state; reason=%d\n", reason);
+    MODLOG_DFLT(ERROR, "Resetting state; reason=%d\n", reason);
 }
 
 static void
@@ -274,13 +266,7 @@ tbb_init(void)
 {
     int rc;
 
-    /* Initialize the tbb log. */
-    log_register("tbb", &tbb_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
-
     /* Initialize the NimBLE host configuration. */
-    log_register("ble_hs", &ble_hs_log, &log_console_handler, NULL,
-                 LOG_SYSLEVEL);
     ble_hs_cfg.reset_cb = tbb_on_reset;
     ble_hs_cfg.sync_cb = tbb_on_sync;
 
diff --git a/apps/testbench/src/testbench.c b/apps/testbench/src/testbench.c
index 108301a0d7..895e61fa1a 100644
--- a/apps/testbench/src/testbench.c
+++ b/apps/testbench/src/testbench.c
@@ -26,6 +26,7 @@
 #include <shell/shell.h>
 #endif
 #include <log/log.h>
+#include <modlog/modlog.h>
 #include <stats/stats.h>
 #include <config/config.h>
 #include "flash_map/flash_map.h"
@@ -170,9 +171,10 @@ testbench_ts_result(char *msg, void *arg, bool passed)
         total_fails++;
     }
 
-    LOG_INFO(&testlog, LOG_MODULE_TEST,
-            "{\"k\":\"%s\",\"n\":\"%s\",\"s\":\"%s\",\"m\":\"%s\",\"r\":%d}",
-             runtest_token, n, s, m, passed);
+    MODLOG_INFO(
+        LOG_MODULE_TEST,
+        "{\"k\":\"%s\",\"n\":\"%s\",\"s\":\"%s\",\"m\":\"%s\",\"r\":%d}",
+        runtest_token, n, s, m, passed);
 }
 
 void
@@ -260,16 +262,15 @@ testbench_runtests(struct os_event *ev)
 static void
 testbench_test_complete(void)
 {
-    LOG_INFO(&testlog, LOG_MODULE_TEST, "%s Done", runtest_token);
-    LOG_INFO(&testlog, LOG_MODULE_TEST,
-             "%s TESTBENCH TEST %s - Tests run:%d pass:%d fail:%d %s",
-             buildID,
-             (total_fails ? "FAILED" : "PASSED"),
-             total_tests,
-             (total_tests-total_fails),
-             total_fails,
-             runtest_token);
-    return;
+    MODLOG_INFO(LOG_MODULE_TEST, "%s Done", runtest_token);
+    MODLOG_INFO(LOG_MODULE_TEST,
+                "%s TESTBENCH TEST %s - Tests run:%d pass:%d fail:%d %s",
+                buildID,
+                (total_fails ? "FAILED" : "PASSED"),
+                total_tests,
+                (total_tests-total_fails),
+                total_fails,
+                runtest_token);
 }
 
 /*
@@ -388,8 +389,10 @@ main(int argc, char **argv)
     cbmem_init(&cbmem, cbmem_buf, MAX_CBMEM_BUF);
     log_register("testlog", &testlog, &log_cbmem_handler, &cbmem, LOG_SYSLEVEL);
 
+    rc = modlog_register(LOG_MODULE_TEST, &testlog, LOG_LEVEL_DEBUG, NULL);
+    assert(rc == 0);
+
     /* Initialize the OIC  */
-    log_register("oic", &oc_log, &log_console_handler, NULL, LOG_SYSLEVEL);
     oc_main_init((oc_handler_t *)&omgr_oc_handler);
 
 #if MYNEWT_VAL(TESTBENCH_BLE)
@@ -418,7 +421,7 @@ main(int argc, char **argv)
      */
     run_evcb_set((os_event_fn*) testbench_runtests);
 
-    LOG_INFO(&testlog, LOG_MODULE_TEST, "testbench app initialized");
+    MODLOG_INFO(LOG_MODULE_TEST, "testbench app initialized");
 
     while (1) {
         os_eventq_run(os_eventq_dflt_get());
diff --git a/apps/testbench/src/testbench.h b/apps/testbench/src/testbench.h
index 815c061d50..869725230a 100644
--- a/apps/testbench/src/testbench.h
+++ b/apps/testbench/src/testbench.h
@@ -63,7 +63,7 @@
 #include "mbedtls/mbedtls_test.h"
 
 #ifdef __cplusplus
-#extern "C" {
+extern "C" {
 #endif
 
 #ifndef IMGMGR_HASH_LEN
@@ -81,7 +81,6 @@ int g_led_pin;
  */
 int testbench_nffs();
 extern struct nffs_area_desc *nffs_current_area_descs;
-extern struct log nffs_log; /* defined in the OS module */
 #endif
 
 /*
diff --git a/apps/testbench/src/testbench_json.c b/apps/testbench/src/testbench_json.c
index b225b164e3..58fa7a5c91 100644
--- a/apps/testbench/src/testbench_json.c
+++ b/apps/testbench/src/testbench_json.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "testutil/testutil.h"
 #include "testbench.h"
 
@@ -31,12 +32,7 @@ extern char *bigbuf;
 void
 testbench_json_init(void *arg)
 {
-    /*
-     * Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-     * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-     */
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s testbench json_init", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench json_init", buildID);
 
     bigbuf = os_malloc(JSON_BIGBUF_SIZE);
 
@@ -55,7 +51,7 @@ TEST_CASE_DECL(test_json_simple_decode);
 
 TEST_SUITE(testbench_json_suite)
 {
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST, "%s testbench_json", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_json", buildID);
 
     tu_suite_set_init_cb(testbench_json_init, NULL);
     tu_suite_set_complete_cb(testbench_json_complete, NULL);
@@ -69,7 +65,7 @@ testbench_json()
 {
     tu_suite_set_init_cb(testbench_json_init, NULL);
     tu_suite_set_complete_cb(testbench_json_complete, NULL);
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST, "%s testbench_json", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_json", buildID);
     testbench_json_suite();
 
     return tu_any_failed;
diff --git a/apps/testbench/src/testbench_mempool.c b/apps/testbench/src/testbench_mempool.c
index 89a6cbe6d7..d44ecae250 100644
--- a/apps/testbench/src/testbench_mempool.c
+++ b/apps/testbench/src/testbench_mempool.c
@@ -16,9 +16,11 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 #include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "testutil/testutil.h"
 #include "testbench.h"
 
@@ -47,12 +49,7 @@ void *block_array[MEMPOOL_TEST_MAX_BLOCKS];
 void
 testbench_mempool_init(void *arg)
 {
-    /*
-     * Lorem ipsum dolor sit amet, consectetur adipiscing elit,
-     * sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
-     */
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s testbench mempool_init", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench mempool_init", buildID);
 
     TstMembufSz = (sizeof(os_membuf_t) *
                    OS_MEMPOOL_SIZE(NUM_MEM_BLOCKS, MEM_BLOCK_SIZE));
@@ -72,7 +69,7 @@ TEST_CASE_DECL(os_mempool_test_case)
 
 TEST_SUITE(testbench_mempool_suite)
 {
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST, "%s testbench_mempool", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_mempool", buildID);
 
     tu_suite_set_init_cb(testbench_mempool_init, NULL);
     tu_suite_set_complete_cb(testbench_mempool_complete, NULL);
@@ -85,7 +82,7 @@ testbench_mempool()
 {
     tu_suite_set_init_cb(testbench_mempool_init, NULL);
     tu_suite_set_complete_cb(testbench_mempool_complete, NULL);
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST, "%s testbench_mempool", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_mempool", buildID);
     testbench_mempool_suite();
 
     return tu_any_failed;
diff --git a/apps/testbench/src/testbench_mutex.c b/apps/testbench/src/testbench_mutex.c
index 9343c38507..bbff8e3526 100644
--- a/apps/testbench/src/testbench_mutex.c
+++ b/apps/testbench/src/testbench_mutex.c
@@ -16,13 +16,14 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #include <sys/time.h>
 #include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "testutil/testutil.h"
-
 #include "testbench.h"
 
 #ifdef ARCH_sim
@@ -39,8 +40,7 @@ volatile int g_mutex_test;
 void
 testbench_mutex_ts_init(void *arg)
 {
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s starting %s", buildID, tu_case_name);
+    MODLOG_DFLT(DEBUG, "%s starting %s", buildID, tu_case_name);
 }
 
 /*
@@ -112,8 +112,7 @@ testbench_mutex_init(void *arg)
     tu_case_idx = 0;
     tu_case_failed = 0;
 
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s testbench test_init", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench test_init", buildID);
 
     tu_suite_set_pass_cb(testbench_ts_pass, NULL);
     tu_suite_set_fail_cb(testbench_ts_fail, NULL);
@@ -127,8 +126,7 @@ TEST_SUITE(testbench_mutex_suite)
 {
     int taskcount;
 
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s mutex_suite start", buildID);
+    MODLOG_DFLT(DEBUG, "%s mutex_suite start", buildID);
 
     taskcount = 1;
     tu_case_set_post_cb(testbench_mutex_tc_posttest, (void*)taskcount);
diff --git a/apps/testbench/src/testbench_sem.c b/apps/testbench/src/testbench_sem.c
index 4f6e67a9e8..89b02ff8c6 100644
--- a/apps/testbench/src/testbench_sem.c
+++ b/apps/testbench/src/testbench_sem.c
@@ -20,8 +20,8 @@
 #include <stdio.h>
 #include <string.h>
 #include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "testutil/testutil.h"
-
 #include "testbench.h"
 
 #define SEM_TEST_STACK_SIZE     256
@@ -31,8 +31,7 @@ struct os_sem g_sem1;
 void
 testbench_sem_ts_init(void *arg)
 {
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s starting %s", buildID, tu_case_name);
+    MODLOG_DFLT(DEBUG, "%s starting %s", buildID, tu_case_name);
 }
 
 void sem_test_basic_handler(void* arg);
@@ -72,8 +71,8 @@ testbench_sem_init(void *arg)
     tu_case_idx = 0;
     tu_case_failed = 0;
 
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST, "%s testbench_sem suite init",
-              buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_sem suite init",
+                buildID);
 
     tu_suite_set_pass_cb(testbench_ts_pass, NULL);
     tu_suite_set_fail_cb(testbench_ts_fail, NULL);
@@ -133,8 +132,7 @@ testbench_sem()
     tu_suite_set_init_cb(testbench_sem_init, NULL);
     testbench_sem_suite();
 
-    LOG_DEBUG(&testlog, LOG_MODULE_TEST,
-             "%s testbench_sem suite complete", buildID);
+    MODLOG_DFLT(DEBUG, "%s testbench_sem suite complete", buildID);
 
     return;
 }
diff --git a/fs/nffs/pkg.yml b/fs/nffs/pkg.yml
index 276f4565b9..492b12218b 100644
--- a/fs/nffs/pkg.yml
+++ b/fs/nffs/pkg.yml
@@ -33,8 +33,9 @@ pkg.deps:
     - kernel/os
     - test/testutil
     - sys/flash_map
+    - sys/log/modlog
+
 pkg.req_apis:
-    - log
     - stats
 
 pkg.init:
diff --git a/fs/nffs/src/nffs.c b/fs/nffs/src/nffs.c
index cd48e4302e..7359a694de 100644
--- a/fs/nffs/src/nffs.c
+++ b/fs/nffs/src/nffs.c
@@ -57,8 +57,6 @@ struct nffs_inode_entry *nffs_lost_found_dir;
 
 static struct os_mutex nffs_mutex;
 
-struct log nffs_log;
-
 static int nffs_open(const char *path, uint8_t access_flags,
   struct fs_file **out_file);
 static int nffs_close(struct fs_file *fs_file);
diff --git a/fs/nffs/src/nffs_priv.h b/fs/nffs/src/nffs_priv.h
index 2ca3b9c02b..2203b47004 100644
--- a/fs/nffs/src/nffs_priv.h
+++ b/fs/nffs/src/nffs_priv.h
@@ -21,8 +21,8 @@
 #define H_NFFS_PRIV_
 
 #include <inttypes.h>
-#include "log/log.h"
 #include "os/mynewt.h"
+#include "modlog/modlog.h"
 #include "nffs/nffs.h"
 #include "fs/fs.h"
 #include "crc/crc16.h"
@@ -299,8 +299,6 @@ extern struct nffs_hash_list *nffs_hash;
 extern struct nffs_inode_entry *nffs_root_dir;
 extern struct nffs_inode_entry *nffs_lost_found_dir;
 
-extern struct log nffs_log;
-
 /* @area */
 int nffs_area_magic_is_set(const struct nffs_disk_area *disk_area);
 int nffs_area_is_scratch(const struct nffs_disk_area *disk_area);
@@ -512,19 +510,8 @@ int nffs_write_to_file(struct nffs_file *file, const void *data, int len);
 
 #define NFFS_FLASH_LOC_NONE  nffs_flash_loc(NFFS_AREA_ID_NONE, 0)
 
-#if 0
-#ifdef ARCH_sim
-#include <stdio.h>
-#define NFFS_LOG(lvl, ...) \
-    printf(__VA_ARGS__)
-#else
-#define NFFS_LOG(lvl, ...) \
-    LOG_ ## lvl(&nffs_log, LOG_MODULE_NFFS, __VA_ARGS__)
-#endif
-#endif /* 0 */
-
 #define NFFS_LOG(lvl, ...) \
-    LOG_ ## lvl(&nffs_log, LOG_MODULE_NFFS, __VA_ARGS__)
+    MODLOG_ ## lvl(LOG_MODULE_NFFS, __VA_ARGS__)
 
 #ifdef __cplusplus
 }
diff --git a/hw/drivers/bq27z561/pkg.yml b/hw/drivers/bq27z561/pkg.yml
index 532c9875e1..45e5d52280 100644
--- a/hw/drivers/bq27z561/pkg.yml
+++ b/hw/drivers/bq27z561/pkg.yml
@@ -28,13 +28,13 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/battery"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BQ27Z561_CLI:
     - "@apache-mynewt-core/util/parse"
 
 pkg.init:
-    bq27z561_pkg_init: 500
\ No newline at end of file
+    bq27z561_pkg_init: 500
diff --git a/hw/drivers/bq27z561/src/bq27z561.c b/hw/drivers/bq27z561/src/bq27z561.c
index 3cacfb8f17..64ac9cb101 100644
--- a/hw/drivers/bq27z561/src/bq27z561.c
+++ b/hw/drivers/bq27z561/src/bq27z561.c
@@ -29,17 +29,15 @@
 #include "battery/battery_prop.h"
 
 #if MYNEWT_VAL(BQ27Z561_LOG)
-#include "log/log.h"
+#include "modlog/modlog.h"
 #endif
 
 #if MYNEWT_VAL(BQ27Z561_LOG)
-static struct log bq27z561_log;
-#define LOG_MODULE_BQ27Z561 (253)
-#define BQ27Z561_ERROR(...) LOG_ERROR(&bq27z561_log, LOG_MODULE_BQ27Z561, __VA_ARGS__)
-#define BQ27Z561_INFO(...)  LOG_INFO(&bq27z561_log, LOG_MODULE_BQ27Z561, __VA_ARGS__)
+
+#define BQ27Z561_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BQ27Z561_LOG_MODULE), __VA_ARGS__)
 #else
-#define BQ27Z561_ERROR(...)
-#define BQ27Z561_INFO(...)
+#define BQ27Z561_LOG(lvl_, ...)
 #endif
 
 static uint8_t
@@ -140,7 +138,7 @@ bq27z561_rd_std_reg_byte(struct bq27z561 *dev, uint8_t reg, uint8_t *val)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 0);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         return rc;
     }
 
@@ -148,7 +146,7 @@ bq27z561_rd_std_reg_byte(struct bq27z561 *dev, uint8_t reg, uint8_t *val)
     i2c.buffer = (uint8_t *)val;
     rc = hal_i2c_master_read(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (rd) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (rd) failed 0x%02X\n", reg);
         return rc;
     }
 
@@ -237,7 +235,7 @@ bq27z561_wr_std_reg_word(struct bq27z561 *dev, uint8_t reg, uint16_t val)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg write 0x%02X failed\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg write 0x%02X failed\n", reg);
         goto err;
     }
 
@@ -284,7 +282,7 @@ bq27x561_wr_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *buf,
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
     }
 
@@ -323,7 +321,7 @@ bq27x561_rd_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *val,
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -335,7 +333,7 @@ bq27x561_rd_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *val,
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 0);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -345,7 +343,7 @@ bq27x561_rd_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *val,
     i2c.buffer = tmpbuf;
     rc = hal_i2c_master_read(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (rd) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (rd) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -357,7 +355,7 @@ bq27x561_rd_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *val,
     cmd_read = tmpbuf[0];
     cmd_read |= ((uint16_t)tmpbuf[1]) << 8;
     if (cmd_read != cmd) {
-        BQ27Z561_ERROR("cmd mismatch (cmd=%x cmd_ret=%x\n", cmd, cmd_read);
+        BQ27Z561_LOG(ERROR, "cmd mismatch (cmd=%x cmd_ret=%x\n", cmd, cmd_read);
         rc = BQ27Z561_ERR_CMD_MISMATCH;
         goto err;
     }
@@ -377,7 +375,7 @@ bq27x561_rd_alt_mfg_cmd(struct bq27z561 *dev, uint16_t cmd, uint8_t *val,
     len -= 2;
     chksum = bq27z561_calc_chksum(tmpbuf, len);
     if (chksum != tmpbuf[34]) {
-        BQ27Z561_ERROR("chksum failure for cmd %u (calc=%u read=%u)", cmd,
+        BQ27Z561_LOG(ERROR, "chksum failure for cmd %u (calc=%u read=%u)", cmd,
                        chksum, tmpbuf[34]);
         rc = BQ27Z561_ERR_CHKSUM_FAIL;
     }
@@ -426,7 +424,7 @@ bq27x561_rd_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -438,7 +436,7 @@ bq27x561_rd_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 0);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -448,7 +446,7 @@ bq27x561_rd_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
     i2c.buffer = tmpbuf;
     rc = hal_i2c_master_read(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (rd) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (rd) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         bq27z561_itf_unlock(&dev->bq27_itf);
         goto err;
@@ -460,7 +458,7 @@ bq27x561_rd_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
     addr_read = tmpbuf[0];
     addr_read |= ((uint16_t)tmpbuf[1]) << 8;
     if (addr_read != addr) {
-        BQ27Z561_ERROR("addr mismatch (addr_read=%x addr_ret=%x\n", cmd,
+        BQ27Z561_LOG(ERROR, "addr mismatch (addr_read=%x addr_ret=%x\n", cmd,
                         cmd_read);
         rc = BQ27Z561_ERR_FLASH_ADDR_MISMATCH;
         goto err;
@@ -507,7 +505,7 @@ bq27x561_wr_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
         goto err;
     }
@@ -524,7 +522,7 @@ bq27x561_wr_flash(struct bq27z561 *dev, uint16_t addr, uint8_t *buf, int buflen)
 
     rc = hal_i2c_master_write(dev->bq27_itf.itf_num, &i2c, OS_TICKS_PER_SEC, 1);
     if (rc != 0) {
-        BQ27Z561_ERROR("I2C reg read (wr) failed 0x%02X\n", reg);
+        BQ27Z561_LOG(ERROR, "I2C reg read (wr) failed 0x%02X\n", reg);
         rc = BQ27Z561_ERR_I2C_ERR;
     }
 
diff --git a/hw/drivers/bq27z561/syscfg.yml b/hw/drivers/bq27z561/syscfg.yml
index 8458e09e4e..edf4474dfd 100644
--- a/hw/drivers/bq27z561/syscfg.yml
+++ b/hw/drivers/bq27z561/syscfg.yml
@@ -27,6 +27,9 @@ syscfg.defs:
     BQ27Z561_LOG:
         description: 'Enable BQ27Z561 logging'
         value: 0
+    BQ27Z561_LOG_MODULE:
+        description: 'Numeric module ID to use for BQ27Z561 log messages'
+        value: 111
     BQ27Z561_SHELL_DEV_NAME:
         description: 'BQ27Z561 Shell device name'
         value: "\"bq27z561_0\""
diff --git a/hw/drivers/drv2605/pkg.yml b/hw/drivers/drv2605/pkg.yml
index 8561f2b52b..38dfa91bfd 100644
--- a/hw/drivers/drv2605/pkg.yml
+++ b/hw/drivers/drv2605/pkg.yml
@@ -32,6 +32,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.deps.DRV2605_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/drv2605/src/drv2605.c b/hw/drivers/drv2605/src/drv2605.c
index f36c2b82ce..6b4d845985 100644
--- a/hw/drivers/drv2605/src/drv2605.c
+++ b/hw/drivers/drv2605/src/drv2605.c
@@ -28,7 +28,7 @@
 #include "drv2605_priv.h"
 
 #if MYNEWT_VAL(DRV2605_LOG)
-#include "log/log.h"
+#include "modlog/modlog.h"
 #endif
 
 #if MYNEWT_VAL(DRV2605_STATS)
@@ -50,17 +50,12 @@ STATS_NAME_END(drv2605_stat_section)
 STATS_SECT_DECL(drv2605_stat_section) g_drv2605stats;
 #endif
 
-#if MYNEWT_VAL(DRV2605_LOG)
-#define LOG_MODULE_DRV2605 (306)
-#define DRV2605_INFO(...)  LOG_INFO(&_log, LOG_MODULE_DRV2605, __VA_ARGS__)
-#define DRV2605_ERR(...)   LOG_ERROR(&_log, LOG_MODULE_DRV2605, __VA_ARGS__)
-static struct log _log;
+#define DRV2605_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(DRV2605_LOG_MODULE), __VA_ARGS__)
 #else
-#define DRV2605_INFO(...)
-#define DRV2605_ERR(...)
+#define DRV2605_LOG(lvl_, ...)
 #endif
 
-
 /**
  * Writes a single byte to the specified register
  *
@@ -84,8 +79,9 @@ drv2605_write8(struct sensor_itf *itf, uint8_t reg, uint8_t value)
 
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC, 1);
     if (rc) {
-        DRV2605_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
-                       data_struct.address, reg, value);
+        DRV2605_LOG(ERROR,
+                    "Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
+                    data_struct.address, reg, value);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -126,7 +122,8 @@ drv2605_writelen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        DRV2605_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        DRV2605_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    data_struct.address);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -163,8 +160,9 @@ drv2605_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     payload = reg;
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        DRV2605_ERR("I2C register write failed at address 0x%02X:0x%02X\n",
-                   data_struct.address, reg);
+        DRV2605_LOG(ERROR,
+                    "I2C register write failed at address 0x%02X:0x%02X\n",
+                    data_struct.address, reg);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -176,7 +174,8 @@ drv2605_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     *value = payload;
     if (rc) {
-        DRV2605_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        DRV2605_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    data_struct.address, reg);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -217,7 +216,8 @@ drv2605_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        DRV2605_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        DRV2605_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    data_struct.address);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -229,7 +229,8 @@ drv2605_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        DRV2605_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        DRV2605_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    data_struct.address, reg);
 #if MYNEWT_VAL(DRV2605_STATS)
         STATS_INC(g_drv2605stats, errors);
 #endif
@@ -282,10 +283,6 @@ drv2605_init(struct os_dev *dev, void *arg)
 
     drv2605 = (struct drv2605 *) dev;
 
-#if MYNEWT_VAL(DRV2605_LOG)
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-#endif
-
     sensor = &drv2605->sensor;
 
 #if MYNEWT_VAL(DRV2605_STATS)
@@ -314,7 +311,7 @@ drv2605_init(struct os_dev *dev, void *arg)
     /* Check if we can read the chip address */
     rc = drv2605_get_chip_id(arg, &id);
     if (rc) {
-        DRV2605_ERR("unable to get chip id [1]: %d\n", rc);
+        DRV2605_LOG(ERROR, "unable to get chip id [1]: %d\n", rc);
         goto err;
     }
 
@@ -323,21 +320,23 @@ drv2605_init(struct os_dev *dev, void *arg)
 
         rc = drv2605_get_chip_id(arg, &id);
         if (rc) {
-            DRV2605_ERR("unable to get chip id [2]: %d\n", rc);
+            DRV2605_LOG(ERROR, "unable to get chip id [2]: %d\n", rc);
             goto err;
         }
 
         if (id != DRV2605_STATUS_DEVICE_ID_2605 && id != DRV2605_STATUS_DEVICE_ID_2605L) {
             rc = SYS_EINVAL;
-            DRV2605_ERR("id not as expected: got: %d, expected %d or %d\n", id,
-                        DRV2605_STATUS_DEVICE_ID_2605, DRV2605_STATUS_DEVICE_ID_2605L);
+            DRV2605_LOG(ERROR,
+                        "id not as expected: got: %d, expected %d or %d\n", id,
+                        DRV2605_STATUS_DEVICE_ID_2605,
+                        DRV2605_STATUS_DEVICE_ID_2605L);
             goto err;
         }
     }
 
     return (0);
 err:
-    DRV2605_ERR("Error initializing DRV2605: %d\n", rc);
+    DRV2605_LOG(ERROR, "Error initializing DRV2605: %d\n", rc);
     return (rc);
 }
 
diff --git a/hw/drivers/drv2605/syscfg.yml b/hw/drivers/drv2605/syscfg.yml
index 5946ea9bc5..70a14bee0a 100644
--- a/hw/drivers/drv2605/syscfg.yml
+++ b/hw/drivers/drv2605/syscfg.yml
@@ -24,6 +24,9 @@ syscfg.defs:
     DRV2605_LOG:
         description: 'Enable DRV2605 logging'
         value: 0
+    DRV2605_LOG_MODULE:
+        description: 'Numeric module ID to use for DRV2605 log messages'
+        value: 205
     DRV2605_STATS:
         description: 'Enable DRV2605 statistics'
         value: 0
diff --git a/hw/drivers/led/lp5523/pkg.yml b/hw/drivers/led/lp5523/pkg.yml
index 51126a1610..ae78f2ca66 100644
--- a/hw/drivers/led/lp5523/pkg.yml
+++ b/hw/drivers/led/lp5523/pkg.yml
@@ -30,10 +30,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/drivers/led"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.deps.LP5523_CLI:
     - "@apache-mynewt-core/util/parse"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/led/lp5523/src/lp5523.c b/hw/drivers/led/lp5523/src/lp5523.c
index a0720f0aa1..c156db8271 100644
--- a/hw/drivers/led/lp5523/src/lp5523.c
+++ b/hw/drivers/led/lp5523/src/lp5523.c
@@ -19,7 +19,7 @@
 
 #include "os/mynewt.h"
 #include <hal/hal_i2c.h>
-#include <log/log.h>
+#include <modlog/modlog.h>
 #include <stats/stats.h>
 #include <string.h>
 
@@ -45,10 +45,11 @@ STATS_NAME_END(lp5523_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lp5523_stat_section) g_lp5523stats;
 
-#define LOG_MODULE_LP5523    (5523)
-#define LP5523_INFO(...)     LOG_INFO(&_log, LOG_MODULE_LP5523, __VA_ARGS__)
-#define LP5523_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_LP5523, __VA_ARGS__)
-static struct log _log;
+#define LP5523_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LP5523_LOG_MODULE), __VA_ARGS__)
+#else
+#define LP5523_LOG(lvl_, ...)
+#endif
 
 int
 lp5523_set_reg(struct led_itf *itf, enum lp5523_registers addr,
@@ -72,8 +73,9 @@ lp5523_set_reg(struct led_itf *itf, enum lp5523_registers addr,
                               OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        LP5523_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
-                       itf->li_addr, addr, value);
+        LP5523_LOG(ERROR,
+                   "Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
+                   itf->li_addr, addr, value);
         STATS_INC(g_lp5523stats, read_errors);
     }
 
@@ -103,7 +105,8 @@ lp5523_get_reg(struct led_itf *itf, enum lp5523_registers addr,
     rc = hal_i2c_master_write(itf->li_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        LP5523_ERR("I2C access failed at address 0x%02X\n", itf->li_addr);
+        LP5523_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                   itf->li_addr);
         STATS_INC(g_lp5523stats, write_errors);
         goto err;
     }
@@ -114,7 +117,8 @@ lp5523_get_reg(struct led_itf *itf, enum lp5523_registers addr,
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-         LP5523_ERR("Failed to read from 0x%02X:0x%02X\n", itf->li_addr, addr);
+         LP5523_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    itf->li_addr, addr);
          STATS_INC(g_lp5523stats, read_errors);
     }
 
@@ -150,7 +154,8 @@ lp5523_set_n_regs(struct led_itf *itf, enum lp5523_registers addr,
                               (OS_TICKS_PER_SEC / 5), 1);
 
     if (rc) {
-        LP5523_ERR("Failed to write to 0x%02X:0x%02X\n", itf->li_addr, regs[0]);
+        LP5523_LOG(ERROR, "Failed to write to 0x%02X:0x%02X\n", itf->li_addr,
+                   regs[0]);
         STATS_INC(g_lp5523stats, read_errors);
     }
 
@@ -182,7 +187,8 @@ lp5523_get_n_regs(struct led_itf *itf, enum lp5523_registers addr,
         (OS_TICKS_PER_SEC / 10), 0);
 
     if (rc) {
-        LP5523_ERR("Failed to write to 0x%02X:0x%02X\n", itf->li_addr, addr_b);
+        LP5523_LOG(ERROR, "Failed to write to 0x%02X:0x%02X\n", itf->li_addr,
+                   addr_b);
         STATS_INC(g_lp5523stats, read_errors);
         goto err;
     }
@@ -193,8 +199,8 @@ lp5523_get_n_regs(struct led_itf *itf, enum lp5523_registers addr,
         OS_TICKS_PER_SEC / 5, 1);
 
     if (rc) {
-         LP5523_ERR("Failed to read from 0x%02X:0x%02X\n", itf->li_addr,
-            addr_b);
+         LP5523_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n", itf->li_addr,
+                    addr_b);
          STATS_INC(g_lp5523stats, read_errors);
     }
 
@@ -931,9 +937,6 @@ lp5523_init(struct os_dev *dev, void *arg)
         return SYS_ENODEV;
     }
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL,
-        LOG_SYSLEVEL);
-
     /* Initialise the stats entry */
     rc = stats_init(
         STATS_HDR(g_lp5523stats),
diff --git a/hw/drivers/led/lp5523/syscfg.yml b/hw/drivers/led/lp5523/syscfg.yml
index 45db86a98f..c61e642756 100644
--- a/hw/drivers/led/lp5523/syscfg.yml
+++ b/hw/drivers/led/lp5523/syscfg.yml
@@ -36,3 +36,6 @@ syscfg.defs:
     LP5523_ITF_LOCK_TMO:
         description: 'LP5523 interface lock timeout in milliseconds'
         value: 1000
+    LP5523_LOG_MODULE:
+        description: 'Numeric module ID to use for LP5523 log messages'
+        value: 105
diff --git a/hw/drivers/sensors/adxl345/pkg.yml b/hw/drivers/sensors/adxl345/pkg.yml
index 8b2ac91da8..c54e8baf60 100644
--- a/hw/drivers/sensors/adxl345/pkg.yml
+++ b/hw/drivers/sensors/adxl345/pkg.yml
@@ -31,10 +31,10 @@ pkg.deps:
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.ADXL345_CLI:
-    - "@apache-mynewt-core/util/parse"
\ No newline at end of file
+    - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/adxl345/src/adxl345.c b/hw/drivers/sensors/adxl345/src/adxl345.c
index 92e2ba13bd..ecf8daac9c 100644
--- a/hw/drivers/sensors/adxl345/src/adxl345.c
+++ b/hw/drivers/sensors/adxl345/src/adxl345.c
@@ -30,7 +30,7 @@
 #include "sensor/accel.h"
 #include "adxl345/adxl345.h"
 #include "adxl345_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -57,10 +57,11 @@ STATS_NAME_END(adxl345_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(adxl345_stat_section) g_adxl345stats;
 
-#define LOG_MODULE_ADXL345    (345)
-#define ADXL345_INFO(...)     LOG_INFO(&_log, LOG_MODULE_ADXL345, __VA_ARGS__)
-#define ADXL345_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_ADXL345, __VA_ARGS__)
-static struct log _log;
+#define ADXL345_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(ADXL345_LOG_MODULE), __VA_ARGS__)
+#else
+#define ADXL345_LOG(lvl_, ...)
+#endif
 
 #define ADXL345_NOTIFY_MASK  0x01
 #define ADXL345_READ_MASK    0x02
@@ -128,7 +129,8 @@ adxl345_i2c_write8(struct sensor_itf *itf, uint8_t reg, uint8_t value)
                               OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        ADXL345_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
+        ADXL345_LOG(ERROR,
+                    "Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
                     itf->si_addr, reg, value);
         STATS_INC(g_adxl345stats, read_errors);
     }
@@ -160,7 +162,9 @@ adxl345_i2c_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        ADXL345_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        ADXL345_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    itf->si_addr)
+                    
         STATS_INC(g_adxl345stats, write_errors);
         return rc;
     }
@@ -171,7 +175,8 @@ adxl345_i2c_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        ADXL345_ERR("Failed to read from 0x%02X:0x%02X - %02X\n", itf->si_addr, reg, rc);
+        ADXL345_LOG(ERROR, "Failed to read from 0x%02X:0x%02X - %02X\n",
+                    itf->si_addr, reg, rc);
         STATS_INC(g_adxl345stats, read_errors);
     }
     return rc;
@@ -202,7 +207,8 @@ adxl345_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        ADXL345_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        ADXL345_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    itf->si_addr);
         STATS_INC(g_adxl345stats, write_errors);
         return rc;
     }
@@ -214,7 +220,8 @@ adxl345_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        ADXL345_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
+        ADXL345_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    itf->si_addr, reg);
         STATS_INC(g_adxl345stats, read_errors);
     }
 
@@ -242,8 +249,8 @@ adxl345_spi_write8(struct sensor_itf *itf, uint8_t reg, uint8_t value)
     rc = hal_spi_tx_val(itf->si_num, reg & ~ADXL345_SPI_READ_CMD_BIT);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        ADXL345_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        ADXL345_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_adxl345stats, write_errors);
         goto err;
     }
@@ -252,8 +259,8 @@ adxl345_spi_write8(struct sensor_itf *itf, uint8_t reg, uint8_t value)
     rc = hal_spi_tx_val(itf->si_num, value);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        ADXL345_ERR("SPI_%u write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        ADXL345_LOG(ERROR, "SPI_%u write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_adxl345stats, write_errors);
         goto err;
     }
@@ -291,8 +298,8 @@ adxl345_spi_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        ADXL345_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        ADXL345_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_adxl345stats, read_errors);
         goto err;
     }
@@ -301,8 +308,8 @@ adxl345_spi_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     retval = hal_spi_tx_val(itf->si_num, 0);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        ADXL345_ERR("SPI_%u read failed addr:0x%02X\n",
-                    itf->si_num, reg);
+        ADXL345_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                     itf->si_num, reg);
         STATS_INC(g_adxl345stats, read_errors);
         goto err;
     }
@@ -342,8 +349,8 @@ adxl345_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        ADXL345_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        ADXL345_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_adxl345stats, read_errors);
         goto err;
     }
@@ -353,8 +360,8 @@ adxl345_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            ADXL345_ERR("SPI_%u read failed addr:0x%02X\n",
-                       itf->si_num, reg);
+            ADXL345_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                        itf->si_num, reg);
             STATS_INC(g_adxl345stats, read_errors);
             goto err;
         }
@@ -859,7 +866,7 @@ adxl345_set_act_inact_enables(struct sensor_itf *itf, struct adxl345_act_inact_e
     reg |= cfg.act_x       ? (1 << 6) : 0;
     reg |= cfg.act_ac_dc   ? (1 << 7) : 0;
 
-    ADXL345_ERR("act_inact = 0x%x\n", reg);
+    ADXL345_LOG(ERROR, "act_inact = 0x%x\n", reg);
     
     return adxl345_write8(itf, ADXL345_ACT_INACT_CTL, reg);
     
@@ -1379,7 +1386,7 @@ init_intpin(struct adxl345 * adxl345, hal_gpio_irq_handler_t handler,
     }
 
     if (pin < 0) {
-        ADXL345_ERR("Interrupt pin not configured\n");
+        ADXL345_LOG(ERROR, "Interrupt pin not configured\n");
         return SYS_EINVAL;
     }
 
@@ -1395,7 +1402,7 @@ init_intpin(struct adxl345 * adxl345, hal_gpio_irq_handler_t handler,
     } else if (adxl345->sensor.s_itf.si_ints[pdd->int_num].device_pin == 2) {
         pdd->int_route = 0xFF;
     } else {
-        ADXL345_ERR("Route not configured\n");
+        ADXL345_LOG(ERROR, "Route not configured\n");
         return SYS_EINVAL;
     }
 
@@ -1405,7 +1412,7 @@ init_intpin(struct adxl345 * adxl345, hal_gpio_irq_handler_t handler,
                            trig,
                            HAL_GPIO_PULL_NONE);
     if (rc != 0) {
-        ADXL345_ERR("Failed to initialise interrupt pin %d\n", pin);
+        ADXL345_LOG(ERROR, "Failed to initialise interrupt pin %d\n", pin);
         return rc;
     } 
     
@@ -1508,7 +1515,7 @@ adxl345_sensor_handle_interrupt(struct sensor * sensor)
 
     rc = adxl345_clear_interrupts(itf, &int_status);
     if (rc != 0) {
-        ADXL345_ERR("Cound not read int status err=0x%02x\n", rc);
+        ADXL345_LOG(ERROR, "Cound not read int status err=0x%02x\n", rc);
         return rc;
     }
 
@@ -1525,7 +1532,7 @@ adxl345_sensor_handle_interrupt(struct sensor * sensor)
     if ((pdd->registered_mask & ADXL345_READ_MASK) &&
         ((int_status & ADXL345_INT_ACTIVITY_BIT) ||
          (int_status & ADXL345_INT_INACTIVITY_BIT))) {
-        ADXL345_ERR("READ EVT 0x%02x\n", int_status);
+        ADXL345_LOG(ERROR, "READ EVT 0x%02x\n", int_status);
         sensor_mgr_put_read_evt(&pdd->read_ctx);
     }
 
@@ -1737,7 +1744,7 @@ adxl345_sensor_set_notification(struct sensor * sensor,
     struct adxl345_private_driver_data *pdd;
     int rc;
 
-    ADXL345_ERR("Enabling notifications\n");
+    ADXL345_LOG(ERROR, "Enabling notifications\n");
     
     if ((sensor_event_type & ~(SENSOR_EVENT_TYPE_DOUBLE_TAP |
                                SENSOR_EVENT_TYPE_SINGLE_TAP)) != 0) {
@@ -1773,7 +1780,7 @@ adxl345_sensor_set_notification(struct sensor * sensor,
     pdd->notify_ctx.snec_evtype |= sensor_event_type;
     pdd->registered_mask |= ADXL345_NOTIFY_MASK;
 
-    ADXL345_ERR("Enabled notifications\n");
+    ADXL345_LOG(ERROR, "Enabled notifications\n");
     
     return 0;
 #else
diff --git a/hw/drivers/sensors/adxl345/syscfg.yml b/hw/drivers/sensors/adxl345/syscfg.yml
index 46585013f9..85971c2e0d 100644
--- a/hw/drivers/sensors/adxl345/syscfg.yml
+++ b/hw/drivers/sensors/adxl345/syscfg.yml
@@ -50,3 +50,6 @@ syscfg.defs:
     ADXL345_ITF_LOCK_TMO:
         description: 'ADXL345 interface lock timeout in milliseconds'
         value: 1000
+    ADXL345_LOG_MODULE:
+        description: 'Numeric module ID to use for ADXL345 log messages'
+        value: 75
diff --git a/hw/drivers/sensors/bma253/pkg.yml b/hw/drivers/sensors/bma253/pkg.yml
index d1c7a2a713..871402583b 100644
--- a/hw/drivers/sensors/bma253/pkg.yml
+++ b/hw/drivers/sensors/bma253/pkg.yml
@@ -28,10 +28,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BMA253_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/bma253/src/bma253.c b/hw/drivers/sensors/bma253/src/bma253.c
index 80e08bcfac..e99523fedd 100644
--- a/hw/drivers/sensors/bma253/src/bma253.c
+++ b/hw/drivers/sensors/bma253/src/bma253.c
@@ -29,17 +29,15 @@
 #include <syscfg/syscfg.h>
 
 #if MYNEWT_VAL(BMA253_LOG)
-#include "log/log.h"
+#include "modlog/modlog.h"
 #endif
 
 #if MYNEWT_VAL(BMA253_LOG)
-static struct log bma253_log;
-#define LOG_MODULE_BMA253 (253)
-#define BMA253_ERROR(...) LOG_ERROR(&bma253_log, LOG_MODULE_BMA253, __VA_ARGS__)
-#define BMA253_INFO(...)  LOG_INFO(&bma253_log, LOG_MODULE_BMA253, __VA_ARGS__)
+
+#define BMA253_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BMA253_LOG_MODULE), __VA_ARGS__)
 #else
-#define BMA253_ERROR(...)
-#define BMA253_INFO(...)
+#define BMA253_LOG(lvl_, ...)
 #endif
 
 #define BMA253_NOTIFY_MASK  0x01
@@ -168,7 +166,7 @@ get_register(struct bma253 * bma253,
     rc = hal_i2c_master_write(itf->si_num, &oper,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA253_ERROR("I2C access failed at address 0x%02X\n", addr);
+        BMA253_LOG(ERROR, "I2C access failed at address 0x%02X\n", addr);
         goto err;
     }
 
@@ -179,8 +177,8 @@ get_register(struct bma253 * bma253,
     rc = hal_i2c_master_read(itf->si_num, &oper,
                              OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA253_ERROR("I2C read failed at address 0x%02X single byte\n",
-                     addr);
+        BMA253_LOG(ERROR, "I2C read failed at address 0x%02X single byte\n",
+                   addr);
     }
 
 err:
@@ -213,8 +211,8 @@ get_registers(struct bma253 * bma253,
     rc = hal_i2c_master_write(itf->si_num, &oper,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA253_ERROR("I2C access failed at address 0x%02X\n",
-                     addr);
+        BMA253_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                   addr);
         goto err;
     }
 
@@ -225,8 +223,8 @@ get_registers(struct bma253 * bma253,
     rc = hal_i2c_master_read(itf->si_num, &oper,
                              OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA253_ERROR("I2C read failed at address 0x%02X length %u\n",
-                     addr, size);
+        BMA253_LOG(ERROR, "I2C read failed at address 0x%02X length %u\n",
+                   addr, size);
     }
 
 err:
@@ -262,8 +260,8 @@ set_register(struct bma253 * bma253,
     rc = hal_i2c_master_write(itf->si_num, &oper,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA253_ERROR("I2C write failed at address 0x%02X single byte\n",
-                     addr);
+        BMA253_LOG(ERROR, "I2C write failed at address 0x%02X single byte\n",
+                   addr);
     }
 
     switch (bma253->power) {
@@ -380,8 +378,8 @@ quad_to_axis_trigger(struct axis_trigger * axis_trigger,
     axis_trigger->sign = (quad_bits >> 3) & 0x01;
     switch (quad_bits & 0x07) {
     default:
-        BMA253_ERROR("unknown %s quad bits 0x%02X\n",
-                     name_bits, quad_bits);
+        BMA253_LOG(ERROR, "unknown %s quad bits 0x%02X\n",
+                   name_bits, quad_bits);
     case 0x00:
         axis_trigger->axis = -1;
         axis_trigger->axis_known = false;
@@ -471,7 +469,7 @@ bma253_get_g_range(const struct bma253 * bma253,
 
     switch (data & 0x0F) {
     default:
-        BMA253_ERROR("unknown PMU_RANGE reg value 0x%02X\n", data);
+        BMA253_LOG(ERROR, "unknown PMU_RANGE reg value 0x%02X\n", data);
         *g_range = BMA253_G_RANGE_16;
         break;
     case 0x03:
@@ -612,7 +610,7 @@ bma253_get_power_settings(const struct bma253 * bma253,
 
     switch ((data[0] >> 5) & 0x07) {
     default:
-        BMA253_ERROR("unknown PMU_LPW reg value 0x%02X\n", data[0]);
+        BMA253_LOG(ERROR, "unknown PMU_LPW reg value 0x%02X\n", data[0]);
         power_settings->power_mode = BMA253_POWER_MODE_NORMAL;
         break;
     case 0x00:
@@ -2624,7 +2622,7 @@ bma253_get_fifo_cfg(const struct bma253 * bma253,
 
     switch ((data >> 6) & 0x03) {
     case 0x03:
-        BMA253_ERROR("unknown FIFO_CONFIG_1 reg value 0x%02X\n", data);
+        BMA253_LOG(ERROR, "unknown FIFO_CONFIG_1 reg value 0x%02X\n", data);
     case 0x00:
         fifo_cfg->fifo_mode = FIFO_MODE_BYPASS;
         break;
@@ -3071,7 +3069,7 @@ init_intpin(struct bma253 * bma253,
     }
 
     if (pin < 0) {
-        BMA253_ERROR("Interrupt pin not configured\n");
+        BMA253_LOG(ERROR, "Interrupt pin not configured\n");
         return SYS_EINVAL;
     }
 
@@ -3087,7 +3085,7 @@ init_intpin(struct bma253 * bma253,
     } else if (bma253->sensor.s_itf.si_ints[pdd->int_num].device_pin == 2) {
         pdd->int_route = INT_ROUTE_PIN_2;
     } else {
-        BMA253_ERROR("Route not configured\n");
+        BMA253_LOG(ERROR, "Route not configured\n");
         return SYS_EINVAL;
     }
 
@@ -3371,7 +3369,7 @@ axis_offset_compensation(const struct bma253 * bma253,
     }
 
     if (!ready) {
-        BMA253_ERROR("offset compensation already in progress\n");
+        BMA253_LOG(ERROR, "offset compensation already in progress\n");
         return SYS_ETIMEOUT;
     }
 
@@ -3396,7 +3394,7 @@ axis_offset_compensation(const struct bma253 * bma253,
     }
 
     if (count == 0) {
-        BMA253_ERROR("offset compensation did not complete\n");
+        BMA253_LOG(ERROR, "offset compensation did not complete\n");
         return SYS_ETIMEOUT;
     }
 
@@ -3515,15 +3513,15 @@ bma253_query_offsets(struct bma253 * bma253,
 
     mismatch = false;
     if (cfg->offset_x_g != val_offset_x_g) {
-        BMA253_ERROR("X compensation offset value mismatch\n");
+        BMA253_LOG(ERROR, "X compensation offset value mismatch\n");
         mismatch = true;
     }
     if (cfg->offset_y_g != val_offset_y_g) {
-        BMA253_ERROR("Y compensation offset value mismatch\n");
+        BMA253_LOG(ERROR, "Y compensation offset value mismatch\n");
         mismatch = true;
     }
     if (cfg->offset_z_g != val_offset_z_g) {
-        BMA253_ERROR("Z compensation offset value mismatch\n");
+        BMA253_LOG(ERROR, "Z compensation offset value mismatch\n");
         mismatch = true;
     }
 
@@ -3837,7 +3835,7 @@ bma253_wait_for_orient(struct bma253 * bma253,
     pdd = &bma253->pdd;
 
     if (pdd->interrupt) {
-        BMA253_ERROR("Interrupt used\n");
+        BMA253_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -3914,7 +3912,7 @@ bma253_wait_for_high_g(struct bma253 * bma253)
     pdd = &bma253->pdd;
 
     if (pdd->interrupt) {
-        BMA253_ERROR("Interrupt used\n");
+        BMA253_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -3986,7 +3984,7 @@ bma253_wait_for_low_g(struct bma253 * bma253)
     pdd = &bma253->pdd;
 
     if (pdd->interrupt) {
-        BMA253_ERROR("Interrupt used\n");
+        BMA253_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4089,7 +4087,7 @@ bma253_wait_for_tap(struct bma253 * bma253,
     }
 
     if (pdd->interrupt) {
-        BMA253_ERROR("Interrupt used\n");
+        BMA253_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4633,7 +4631,7 @@ sensor_driver_handle_interrupt(struct sensor * sensor)
 
     rc = bma253_get_int_status(bma253, &int_status);
     if (rc != 0) {
-        BMA253_ERROR("Cound not read int status err=0x%02x\n", rc);
+        BMA253_LOG(ERROR, "Cound not read int status err=0x%02x\n", rc);
         return rc;
     }
 
@@ -4684,7 +4682,7 @@ bma253_config(struct bma253 * bma253, struct bma253_cfg * cfg)
         return rc;
     }
     if (chip_id != REG_VALUE_CHIP_ID) {
-        BMA253_ERROR("received incorrect chip ID 0x%02X\n", chip_id);
+        BMA253_LOG(ERROR, "received incorrect chip ID 0x%02X\n", chip_id);
         return SYS_EINVAL;
     }
 
@@ -4720,17 +4718,6 @@ bma253_init(struct os_dev * dev, void * arg)
         return SYS_ENODEV;
     }
 
-#if MYNEWT_VAL(BMA253_LOG)
-    rc = log_register(dev->od_name,
-                      &bma253_log,
-                      &log_console_handler,
-                      NULL,
-                      LOG_SYSLEVEL);
-    if (rc != 0) {
-        return rc;
-    }
-#endif
-
     bma253 = (struct bma253 *)dev;
     sensor = &bma253->sensor;
 
diff --git a/hw/drivers/sensors/bma253/syscfg.yml b/hw/drivers/sensors/bma253/syscfg.yml
index 16c725d1dc..2bcb66e78b 100644
--- a/hw/drivers/sensors/bma253/syscfg.yml
+++ b/hw/drivers/sensors/bma253/syscfg.yml
@@ -48,6 +48,9 @@ syscfg.defs:
     BMA253_LOG:
         description: 'Enable BMA253 logging'
         value: 0
+    BMA253_LOG_MODULE:
+        description: 'Numeric module ID to use for BMA253 log messages'
+        value: 253
     BMA253_SHELL_DEV_NAME:
         description: 'BMA253 Shell device name'
         value: "\"bma253_0\""
diff --git a/hw/drivers/sensors/bma2xx/pkg.yml b/hw/drivers/sensors/bma2xx/pkg.yml
index aaf26ad385..537137a5d3 100644
--- a/hw/drivers/sensors/bma2xx/pkg.yml
+++ b/hw/drivers/sensors/bma2xx/pkg.yml
@@ -29,10 +29,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BMA2XX_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/bma2xx/src/bma2xx.c b/hw/drivers/sensors/bma2xx/src/bma2xx.c
index 624bd38667..173e46032c 100644
--- a/hw/drivers/sensors/bma2xx/src/bma2xx.c
+++ b/hw/drivers/sensors/bma2xx/src/bma2xx.c
@@ -32,17 +32,13 @@
 #include <syscfg/syscfg.h>
 
 #if MYNEWT_VAL(BMA2XX_LOG)
-#include "log/log.h"
+#include "modlog/modlog.h"
 #endif
 
-#if MYNEWT_VAL(BMA2XX_LOG)
-static struct log bma2xx_log;
-#define LOG_MODULE_BMA2XX (200)
-#define BMA2XX_ERROR(...) LOG_ERROR(&bma2xx_log, LOG_MODULE_BMA2XX, __VA_ARGS__)
-#define BMA2XX_INFO(...)  LOG_INFO(&bma2xx_log, LOG_MODULE_BMA2XX, __VA_ARGS__)
+#define BMA2XX_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BMA2XX_LOG_MODULE), __VA_ARGS__)
 #else
-#define BMA2XX_ERROR(...)
-#define BMA2XX_INFO(...)
+#define BMA2XX_LOG(lvl_, ...)
 #endif
 
 #define BMA2XX_NOTIFY_MASK  0x01
@@ -183,8 +179,8 @@ spi_readlen(struct sensor_itf * itf, uint8_t addr, uint8_t *payload,
     retval = hal_spi_tx_val(itf->si_num, addr | BMA2XX_SPI_READ_CMD_BIT);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        BMA2XX_ERROR("SPI_%u register write failed addr:0x%02X\n",
-                     itf->si_num, addr);
+        BMA2XX_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                   itf->si_num, addr);
         goto err;
     }
 
@@ -193,8 +189,8 @@ spi_readlen(struct sensor_itf * itf, uint8_t addr, uint8_t *payload,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            BMA2XX_ERROR("SPI_%u read failed addr:0x%02X\n",
-                         itf->si_num, addr);
+            BMA2XX_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                       itf->si_num, addr);
             goto err;
         }
         payload[i] = retval;
@@ -232,8 +228,8 @@ spi_writereg(struct sensor_itf * itf, uint8_t addr, uint8_t payload,
     rc = hal_spi_tx_val(itf->si_num, addr);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        BMA2XX_ERROR("SPI_%u register write failed addr:0x%02X\n",
-                     itf->si_num, addr);
+        BMA2XX_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                   itf->si_num, addr);
         goto err;
     }
 
@@ -242,8 +238,8 @@ spi_writereg(struct sensor_itf * itf, uint8_t addr, uint8_t payload,
         rc = hal_spi_tx_val(itf->si_num, payload);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            BMA2XX_ERROR("SPI_%u write failed addr:0x%02X:0x%02X\n",
-                         itf->si_num, addr);
+            BMA2XX_LOG(ERROR, "SPI_%u write failed addr:0x%02X:0x%02X\n",
+                       itf->si_num, addr);
             goto err;
         }
     }
@@ -274,8 +270,7 @@ i2c_readlen(struct sensor_itf * itf, uint8_t addr, uint8_t *payload,
     rc = hal_i2c_master_write(itf->si_num, &oper,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA2XX_ERROR("I2C access failed at address 0x%02X\n",
-                     addr);
+        BMA2XX_LOG(ERROR, "I2C access failed at address 0x%02X\n", addr);
         return rc;
     }
 
@@ -286,8 +281,8 @@ i2c_readlen(struct sensor_itf * itf, uint8_t addr, uint8_t *payload,
     rc = hal_i2c_master_read(itf->si_num, &oper,
                              OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA2XX_ERROR("I2C read failed at address 0x%02X length %u\n",
-                     addr, len);
+        BMA2XX_LOG(ERROR, "I2C read failed at address 0x%02X length %u\n",
+                   addr, len);
         return rc;
     }
 
@@ -311,8 +306,8 @@ i2c_writereg(struct sensor_itf * itf, uint8_t addr, uint8_t data)
     rc = hal_i2c_master_write(itf->si_num, &oper,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc != 0) {
-        BMA2XX_ERROR("I2C write failed at address 0x%02X single byte\n",
-                     addr);
+        BMA2XX_LOG(ERROR, "I2C write failed at address 0x%02X single byte\n",
+                   addr);
         return rc;
     }
 
@@ -572,8 +567,8 @@ quad_to_axis_trigger(struct axis_trigger * axis_trigger,
     axis_trigger->sign = (quad_bits >> 3) & 0x01;
     switch (quad_bits & 0x07) {
     default:
-        BMA2XX_ERROR("unknown %s quad bits 0x%02X\n",
-                     name_bits, quad_bits);
+        BMA2XX_LOG(ERROR, "unknown %s quad bits 0x%02X\n",
+                   name_bits, quad_bits);
     case 0x00:
         axis_trigger->axis = -1;
         axis_trigger->axis_known = false;
@@ -663,7 +658,7 @@ bma2xx_get_g_range(struct bma2xx *bma2xx,
 
     switch (data & 0x0F) {
     default:
-        BMA2XX_ERROR("unknown PMU_RANGE reg value 0x%02X\n", data);
+        BMA2XX_LOG(ERROR, "unknown PMU_RANGE reg value 0x%02X\n", data);
         *g_range = BMA2XX_G_RANGE_16;
         break;
     case 0x03:
@@ -823,7 +818,7 @@ bma2xx_get_power_settings(struct bma2xx *bma2xx,
 
     switch ((data[0] >> 5) & 0x07) {
     default:
-        BMA2XX_ERROR("unknown PMU_LPW reg value 0x%02X\n", data[0]);
+        BMA2XX_LOG(ERROR, "unknown PMU_LPW reg value 0x%02X\n", data[0]);
         power_settings->power_mode = BMA2XX_POWER_MODE_NORMAL;
         break;
     case 0x00:
@@ -2835,7 +2830,7 @@ bma2xx_get_fifo_cfg(struct bma2xx *bma2xx,
 
     switch ((data >> 6) & 0x03) {
     case 0x03:
-        BMA2XX_ERROR("unknown FIFO_CONFIG_1 reg value 0x%02X\n", data);
+        BMA2XX_LOG(ERROR, "unknown FIFO_CONFIG_1 reg value 0x%02X\n", data);
     case 0x00:
         fifo_cfg->fifo_mode = FIFO_MODE_BYPASS;
         break;
@@ -3271,7 +3266,7 @@ init_intpin(struct bma2xx *bma2xx,
     }
 
     if (pin < 0) {
-        BMA2XX_ERROR("Interrupt pin not configured\n");
+        BMA2XX_LOG(ERROR, "Interrupt pin not configured\n");
         return SYS_EINVAL;
     }
 
@@ -3287,7 +3282,7 @@ init_intpin(struct bma2xx *bma2xx,
     } else if (bma2xx->sensor.s_itf.si_ints[pdd->int_num].device_pin == 2) {
         pdd->int_route = INT_ROUTE_PIN_2;
     } else {
-        BMA2XX_ERROR("Route not configured\n");
+        BMA2XX_LOG(ERROR, "Route not configured\n");
         return SYS_EINVAL;
     }
 
@@ -3571,7 +3566,7 @@ axis_offset_compensation(struct bma2xx *bma2xx,
     }
 
     if (!ready) {
-        BMA2XX_ERROR("offset compensation already in progress\n");
+        BMA2XX_LOG(ERROR, "offset compensation already in progress\n");
         return SYS_ETIMEOUT;
     }
 
@@ -3596,7 +3591,7 @@ axis_offset_compensation(struct bma2xx *bma2xx,
     }
 
     if (count == 0) {
-        BMA2XX_ERROR("offset compensation did not complete\n");
+        BMA2XX_LOG(ERROR, "offset compensation did not complete\n");
         return SYS_ETIMEOUT;
     }
 
@@ -3715,15 +3710,15 @@ bma2xx_query_offsets(struct bma2xx *bma2xx,
 
     mismatch = false;
     if (cfg->offset_x_g != val_offset_x_g) {
-        BMA2XX_ERROR("X compensation offset value mismatch\n");
+        BMA2XX_LOG(ERROR, "X compensation offset value mismatch\n");
         mismatch = true;
     }
     if (cfg->offset_y_g != val_offset_y_g) {
-        BMA2XX_ERROR("Y compensation offset value mismatch\n");
+        BMA2XX_LOG(ERROR, "Y compensation offset value mismatch\n");
         mismatch = true;
     }
     if (cfg->offset_z_g != val_offset_z_g) {
-        BMA2XX_ERROR("Z compensation offset value mismatch\n");
+        BMA2XX_LOG(ERROR, "Z compensation offset value mismatch\n");
         mismatch = true;
     }
 
@@ -4029,7 +4024,7 @@ bma2xx_wait_for_orient(struct bma2xx *bma2xx,
     pdd = &bma2xx->pdd;
 
     if (pdd->interrupt) {
-        BMA2XX_ERROR("Interrupt used\n");
+        BMA2XX_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4106,7 +4101,7 @@ bma2xx_wait_for_high_g(struct bma2xx *bma2xx)
     pdd = &bma2xx->pdd;
 
     if (pdd->interrupt) {
-        BMA2XX_ERROR("Interrupt used\n");
+        BMA2XX_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4178,7 +4173,7 @@ bma2xx_wait_for_low_g(struct bma2xx *bma2xx)
     pdd = &bma2xx->pdd;
 
     if (pdd->interrupt) {
-        BMA2XX_ERROR("Interrupt used\n");
+        BMA2XX_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4281,7 +4276,7 @@ bma2xx_wait_for_tap(struct bma2xx *bma2xx,
     }
 
     if (pdd->interrupt) {
-        BMA2XX_ERROR("Interrupt used\n");
+        BMA2XX_LOG(ERROR, "Interrupt used\n");
         return SYS_EINVAL;
     }
 
@@ -4791,7 +4786,7 @@ sensor_driver_handle_interrupt(struct sensor * sensor)
 
     rc = bma2xx_get_int_status(bma2xx, &int_status);
     if (rc != 0) {
-        BMA2XX_ERROR("Cound not read int status err=0x%02x\n", rc);
+        BMA2XX_LOG(ERROR, "Cound not read int status err=0x%02x\n", rc);
         return rc;
     }
 
@@ -4853,7 +4848,7 @@ bma2xx_config(struct bma2xx *bma2xx, struct bma2xx_cfg *cfg)
     }
 
     if (chip_id != model_chip_id) {
-        BMA2XX_ERROR("received incorrect chip ID 0x%02X\n", chip_id);
+        BMA2XX_LOG(ERROR, "received incorrect chip ID 0x%02X\n", chip_id);
         return SYS_EINVAL;
     }
 
@@ -4889,17 +4884,6 @@ bma2xx_init(struct os_dev * dev, void * arg)
         return SYS_ENODEV;
     }
 
-#if MYNEWT_VAL(BMA2XX_LOG)
-    rc = log_register(dev->od_name,
-                      &bma2xx_log,
-                      &log_console_handler,
-                      NULL,
-                      LOG_SYSLEVEL);
-    if (rc != 0) {
-        return rc;
-    }
-#endif
-
     bma2xx = (struct bma2xx *)dev;
     sensor = &bma2xx->sensor;
 
diff --git a/hw/drivers/sensors/bma2xx/syscfg.yml b/hw/drivers/sensors/bma2xx/syscfg.yml
index 3b45c848e0..1d0195f655 100644
--- a/hw/drivers/sensors/bma2xx/syscfg.yml
+++ b/hw/drivers/sensors/bma2xx/syscfg.yml
@@ -42,6 +42,9 @@ syscfg.defs:
     BMA2XX_LOG:
         description: 'Enable BMA2XX logging'
         value: 0
+    BMA2XX_LOG_MODULE:
+        description: 'Numeric module ID to use for BMA2XX log messages'
+        value: 200
     BMA2XX_SHELL_DEV_NAME:
         description: 'BMA2XX Shell device name'
         value: "\"bma2xx_0\""
diff --git a/hw/drivers/sensors/bme280/pkg.yml b/hw/drivers/sensors/bme280/pkg.yml
index bf98f70c4d..22a0a6b710 100644
--- a/hw/drivers/sensors/bme280/pkg.yml
+++ b/hw/drivers/sensors/bme280/pkg.yml
@@ -31,10 +31,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BME280_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/bme280/src/bme280.c b/hw/drivers/sensors/bme280/src/bme280.c
index 53c23b485a..0d7c9c6736 100644
--- a/hw/drivers/sensors/bme280/src/bme280.c
+++ b/hw/drivers/sensors/bme280/src/bme280.c
@@ -31,7 +31,7 @@
 #include "sensor/pressure.h"
 #include "bme280_priv.h"
 #include "hal/hal_gpio.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 
 #ifndef MATHLIB_SUPPORT
@@ -62,10 +62,11 @@ STATS_NAME_END(bme280_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(bme280_stat_section) g_bme280stats;
 
-#define LOG_MODULE_BME280    (280)
-#define BME280_INFO(...)     LOG_INFO(&_log, LOG_MODULE_BME280, __VA_ARGS__)
-#define BME280_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_BME280, __VA_ARGS__)
-static struct log _log;
+#define BME280_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BME280_LOG_MODULE), __VA_ARGS__)
+#else
+#define BME280_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int bme280_sensor_read(struct sensor *, sensor_type_t,
@@ -122,8 +123,6 @@ bme280_init(struct os_dev *dev, void *arg)
         goto err;
     }
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &bme280->sensor;
 
     /* Initialise the stats entry */
@@ -200,7 +199,7 @@ bme280_compensate_temperature(int32_t rawtemp, struct bme280_pdd *pdd)
     double var1, var2, comptemp;
 
     if (rawtemp == 0x800000) {
-        BME280_ERR("Invalid temp data\n");
+        BME280_LOG(ERROR, "Invalid temp data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -235,7 +234,7 @@ bme280_compensate_pressure(struct sensor_itf *itf, int32_t rawpress,
     int32_t temp;
 
     if (rawpress == 0x800000) {
-        BME280_ERR("Invalid press data\n");
+        BME280_LOG(ERROR, "Invalid press data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -286,7 +285,7 @@ bme280_compensate_humidity(struct sensor_itf *itf, int32_t rawhumid,
     int32_t temp;
 
     if (rawhumid == 0x8000) {
-        BME280_ERR("Invalid humidity data\n");
+        BME280_LOG(ERROR, "Invalid humidity data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -330,7 +329,7 @@ bme280_compensate_temperature(int32_t rawtemp, struct bme280_pdd *pdd)
     int32_t var1, var2, comptemp;
 
     if (rawtemp == 0x800000) {
-        BME280_ERR("Invalid temp data\n");
+        BME280_LOG(ERROR, "Invalid temp data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -367,7 +366,7 @@ bme280_compensate_pressure(struct sensor_itf *itf, int32_t rawpress,
     int32_t temp;
 
     if (rawpress == 0x800000) {
-        BME280_ERR("Invalid pressure data\n");
+        BME280_LOG(ERROR, "Invalid pressure data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -420,7 +419,7 @@ bme280_compensate_humidity(struct sensor_itf *itf, uint32_t rawhumid,
     int32_t tmp32;
 
     if (rawhumid == 0x8000) {
-        BME280_ERR("Invalid humidity data\n");
+        BME280_LOG(ERROR, "Invalid humidity data\n");
         STATS_INC(g_bme280stats, invalid_data_errors);
         return NAN;
     }
@@ -843,7 +842,7 @@ bme280_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     retval = hal_spi_tx_val(itf->si_num, addr | BME280_SPI_READ_CMD_BIT);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        BME280_ERR("SPI_%u register write failed addr:0x%02X\n",
+        BME280_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                    itf->si_num, addr);
         STATS_INC(g_bme280stats, read_errors);
         goto err;
@@ -854,7 +853,7 @@ bme280_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            BME280_ERR("SPI_%u read failed addr:0x%02X\n",
+            BME280_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
                        itf->si_num, addr);
             STATS_INC(g_bme280stats, read_errors);
             goto err;
@@ -894,7 +893,7 @@ bme280_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     rc = hal_spi_tx_val(itf->si_num, addr & ~BME280_SPI_READ_CMD_BIT);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        BME280_ERR("SPI_%u register write failed addr:0x%02X\n",
+        BME280_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                    itf->si_num, addr);
         STATS_INC(g_bme280stats, write_errors);
         goto err;
@@ -905,7 +904,7 @@ bme280_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         rc = hal_spi_tx_val(itf->si_num, payload[i]);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            BME280_ERR("SPI_%u write failed addr:0x%02X:0x%02X\n",
+            BME280_LOG(ERROR, "SPI_%u write failed addr:0x%02X:0x%02X\n",
                        itf->si_num, addr);
             STATS_INC(g_bme280stats, write_errors);
             goto err;
diff --git a/hw/drivers/sensors/bme280/syscfg.yml b/hw/drivers/sensors/bme280/syscfg.yml
index 6fd65c63d9..f26087e854 100644
--- a/hw/drivers/sensors/bme280/syscfg.yml
+++ b/hw/drivers/sensors/bme280/syscfg.yml
@@ -36,3 +36,6 @@ syscfg.defs:
     BME280_SPEC_CALC:
         description: 'BME280 Spec calculation insetad of built in one'
         value : 1
+    BME280_LOG_MODULE:
+        description: 'Numeric module ID to use for BME280 log messages'
+        value: 208
diff --git a/hw/drivers/sensors/bmp280/pkg.yml b/hw/drivers/sensors/bmp280/pkg.yml
index beff0a4060..ed184b7c20 100644
--- a/hw/drivers/sensors/bmp280/pkg.yml
+++ b/hw/drivers/sensors/bmp280/pkg.yml
@@ -32,10 +32,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BMP280_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/bmp280/src/bmp280.c b/hw/drivers/sensors/bmp280/src/bmp280.c
index c3f4907e68..ca707ef3b5 100644
--- a/hw/drivers/sensors/bmp280/src/bmp280.c
+++ b/hw/drivers/sensors/bmp280/src/bmp280.c
@@ -31,7 +31,7 @@
 #include "sensor/pressure.h"
 #include "bmp280_priv.h"
 #include "hal/hal_gpio.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -63,10 +63,11 @@ STATS_NAME_END(bmp280_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(bmp280_stat_section) g_bmp280stats;
 
-#define LOG_MODULE_BMP280    (2801)
-#define BMP280_INFO(...)     LOG_INFO(&_log, LOG_MODULE_BMP280, __VA_ARGS__)
-#define BMP280_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_BMP280, __VA_ARGS__)
-static struct log _log;
+#define BMP280_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BMP280_LOG_MODULE), __VA_ARGS__)
+#else
+#define BMP280_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int bmp280_sensor_read(struct sensor *, sensor_type_t,
@@ -123,8 +124,6 @@ bmp280_init(struct os_dev *dev, void *arg)
         goto err;
     }
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &bmp280->sensor;
 
     /* Initialise the stats entry */
@@ -202,7 +201,7 @@ bmp280_compensate_temperature(int32_t rawtemp, struct bmp280_pdd *pdd)
     double var1, var2, comptemp;
 
     if (rawtemp == 0x800000) {
-        BMP280_ERR("Invalid temp data\n");
+        BMP280_LOG(ERROR, "Invalid temp data\n");
         STATS_INC(g_bmp280stats, invalid_data_errors);
         return NAN;
     }
@@ -237,7 +236,7 @@ bmp280_compensate_pressure(struct sensor_itf *itf, int32_t rawpress,
     int32_t temp;
 
     if (rawpress == 0x800000) {
-        BMP280_ERR("Invalid press data\n");
+        BMP280_LOG(ERROR, "Invalid press data\n");
         STATS_INC(g_bmp280stats, invalid_data_errors);
         return NAN;
     }
@@ -288,7 +287,7 @@ bmp280_compensate_temperature(int32_t rawtemp, struct bmp280_pdd *pdd)
     int32_t var1, var2, comptemp;
 
     if (rawtemp == 0x800000) {
-        BMP280_ERR("Invalid temp data\n");
+        BMP280_LOG(ERROR, "Invalid temp data\n");
         STATS_INC(g_bmp280stats, invalid_data_errors);
         return NAN;
     }
@@ -326,7 +325,7 @@ bmp280_compensate_pressure(struct sensor_itf *itf, int32_t rawpress,
     int32_t temp;
 
     if (rawpress == 0x800000) {
-        BMP280_ERR("Invalid pressure data\n");
+        BMP280_LOG(ERROR, "Invalid pressure data\n");
         STATS_INC(g_bmp280stats, invalid_data_errors);
         return NAN;
     }
@@ -710,7 +709,7 @@ bmp280_i2c_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        BMP280_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        BMP280_LOG(ERROR, "I2C access failed at address 0x%02X\n", data_struct.address);
         STATS_INC(g_bmp280stats, write_errors);
         goto err;
     }
@@ -720,7 +719,7 @@ bmp280_i2c_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        BMP280_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, addr);
+        BMP280_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n", data_struct.address, addr);
         STATS_INC(g_bmp280stats, read_errors);
         goto err;
     }
@@ -759,7 +758,7 @@ bmp280_spi_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     retval = hal_spi_tx_val(itf->si_num, addr | BMP280_SPI_READ_CMD_BIT);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        BMP280_ERR("SPI_%u register write failed addr:0x%02X\n",
+        BMP280_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                    itf->si_num, addr);
         STATS_INC(g_bmp280stats, read_errors);
         goto err;
@@ -770,7 +769,7 @@ bmp280_spi_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            BMP280_ERR("SPI_%u read failed addr:0x%02X\n",
+            BMP280_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
                        itf->si_num, addr);
             STATS_INC(g_bmp280stats, read_errors);
             goto err;
@@ -820,7 +819,7 @@ bmp280_i2c_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
 
         rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
         if (rc) {
-            BMP280_ERR("Failed to write 0x%02X:0x%02X\n", data_struct.address, addr);
+            BMP280_LOG(ERROR, "Failed to write 0x%02X:0x%02X\n", data_struct.address, addr);
             STATS_INC(g_bmp280stats, write_errors);
             goto err;
         }
@@ -856,7 +855,7 @@ bmp280_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     rc = hal_spi_tx_val(itf->si_num, addr & ~BMP280_SPI_READ_CMD_BIT);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        BMP280_ERR("SPI_%u register write failed addr:0x%02X\n",
+        BMP280_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                    itf->si_num, addr);
         STATS_INC(g_bmp280stats, write_errors);
         goto err;
@@ -867,7 +866,7 @@ bmp280_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         rc = hal_spi_tx_val(itf->si_num, payload[i]);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            BMP280_ERR("SPI_%u write failed addr:0x%02X\n",
+            BMP280_LOG(ERROR, "SPI_%u write failed addr:0x%02X\n",
                        itf->si_num, addr);
             STATS_INC(g_bmp280stats, write_errors);
             goto err;
diff --git a/hw/drivers/sensors/bmp280/syscfg.yml b/hw/drivers/sensors/bmp280/syscfg.yml
index f48b07ea84..2b2828163a 100644
--- a/hw/drivers/sensors/bmp280/syscfg.yml
+++ b/hw/drivers/sensors/bmp280/syscfg.yml
@@ -42,3 +42,6 @@ syscfg.defs:
     BMP280_ITF_LOCK_TMO:
         description: 'BMP280 interface lock timeout in milliseconds'
         value: 1000
+    BMP280_LOG_MODULE:
+        description: 'Numeric module ID to use for BMP280 log messages'
+        value: 209
diff --git a/hw/drivers/sensors/bno055/pkg.yml b/hw/drivers/sensors/bno055/pkg.yml
index fdb455595d..1c9e441d86 100644
--- a/hw/drivers/sensors/bno055/pkg.yml
+++ b/hw/drivers/sensors/bno055/pkg.yml
@@ -30,10 +30,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.BNO055_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/bno055/src/bno055.c b/hw/drivers/sensors/bno055/src/bno055.c
index aeed53ec79..9be19aa639 100644
--- a/hw/drivers/sensors/bno055/src/bno055.c
+++ b/hw/drivers/sensors/bno055/src/bno055.c
@@ -32,7 +32,7 @@
 #include "sensor/temperature.h"
 #include "bno055/bno055.h"
 #include "bno055_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -49,10 +49,11 @@ STATS_NAME_END(bno055_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(bno055_stat_section) g_bno055stats;
 
-#define LOG_MODULE_BNO055 (305)
-#define BNO055_INFO(...)  LOG_INFO(&_log, LOG_MODULE_BNO055, __VA_ARGS__)
-#define BNO055_ERR(...)   LOG_ERROR(&_log, LOG_MODULE_BNO055, __VA_ARGS__)
-static struct log _log;
+#define BNO055_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(BNO055_LOG_MODULE), __VA_ARGS__)
+#else
+#define BNO055_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API.*/
 static int bno055_sensor_read(struct sensor *, sensor_type_t,
@@ -88,8 +89,9 @@ bno055_write8(struct sensor_itf *itf, uint8_t reg, uint8_t value)
 
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC, 1);
     if (rc) {
-        BNO055_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
-                       data_struct.address, reg, value);
+        BNO055_LOG(ERROR,
+                   "Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
+                   data_struct.address, reg, value);
         STATS_INC(g_bno055stats, errors);
     }
 
@@ -134,7 +136,8 @@ bno055_writelen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        BNO055_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        BNO055_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                   data_struct.address);
         STATS_INC(g_bno055stats, errors);
         goto err;
     }
@@ -143,7 +146,8 @@ bno055_writelen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, len);
     if (rc) {
-        BNO055_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        BNO055_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                   data_struct.address, reg);
         STATS_INC(g_bno055stats, errors);;
     }
 
@@ -183,7 +187,8 @@ bno055_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     payload = reg;
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        BNO055_ERR("I2C register write failed at address 0x%02X:0x%02X\n",
+        BNO055_LOG(ERROR,
+                   "I2C register write failed at address 0x%02X:0x%02X\n",
                    data_struct.address, reg);
         STATS_INC(g_bno055stats, errors);
         goto err;
@@ -194,7 +199,8 @@ bno055_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     *value = payload;
     if (rc) {
-        BNO055_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        BNO055_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                   data_struct.address, reg);
         STATS_INC(g_bno055stats, errors);
     }
 
@@ -240,7 +246,8 @@ bno055_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        BNO055_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        BNO055_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                   data_struct.address);
         STATS_INC(g_bno055stats, errors);
         goto err;
     }
@@ -250,7 +257,8 @@ bno055_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        BNO055_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        BNO055_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                   data_struct.address, reg);
         STATS_INC(g_bno055stats, errors);
     }
 
@@ -469,8 +477,6 @@ bno055_init(struct os_dev *dev, void *arg)
         goto err;
     }
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &bno055->sensor;
 
     /* Initialise the stats entry */
@@ -638,7 +644,7 @@ bno055_placement_cfg(struct sensor_itf *itf, uint8_t placement)
         remap_sign = BNO055_REMAP_SIGN_P7;
         break;
     default:
-        BNO055_ERR("Invalid Axis config, Assuming P1(default) \n");
+        BNO055_LOG(ERROR, "Invalid Axis config, Assuming P1(default) \n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -806,7 +812,7 @@ bno055_config(struct bno055 *bno055, struct bno055_cfg *cfg)
         }
 
         if (cfg->bc_opr_mode != mode) {
-            BNO055_ERR("Config mode and read mode do not match.\n");
+            BNO055_LOG(ERROR, "Config mode and read mode do not match.\n");
             rc = SYS_EINVAL;
             goto err;
         }
@@ -906,7 +912,7 @@ bno055_find_reg(sensor_type_t type, uint8_t *reg)
             *reg = BNO055_GRAVITY_DATA_X_LSB_ADDR;
             break;
         default:
-            BNO055_ERR("Not supported sensor type: %d\n", (int)type);
+            BNO055_LOG(ERROR, "Not supported sensor type: %d\n", (int)type);
             rc = SYS_EINVAL;
             break;
     }
@@ -1018,7 +1024,7 @@ bno055_get_vector_data(struct sensor_itf *itf, void *datastruct, int type)
             sad->sad_z_is_valid = 1;
             break;
         default:
-            BNO055_ERR("Not supported sensor type: %d\n", type);
+            BNO055_LOG(ERROR, "Not supported sensor type: %d\n", type);
             rc = SYS_EINVAL;
             goto err;
     }
diff --git a/hw/drivers/sensors/bno055/syscfg.yml b/hw/drivers/sensors/bno055/syscfg.yml
index 4bae5d55a1..39a3609f30 100644
--- a/hw/drivers/sensors/bno055/syscfg.yml
+++ b/hw/drivers/sensors/bno055/syscfg.yml
@@ -33,3 +33,6 @@ syscfg.defs:
     BNO055_ITF_LOCK_TMO:
         description: 'BNO055 interface lock timeout in milliseconds'
         value: 1000
+    BNO055_LOG_MODULE:
+        description: 'Numeric module ID to use for BNO055 log messages'
+        value: 85
diff --git a/hw/drivers/sensors/lis2dh12/pkg.yml b/hw/drivers/sensors/lis2dh12/pkg.yml
index 77ae8d68ae..782c9407e1 100644
--- a/hw/drivers/sensors/lis2dh12/pkg.yml
+++ b/hw/drivers/sensors/lis2dh12/pkg.yml
@@ -28,7 +28,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
index a46be3a8f9..b85554516e 100644
--- a/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
+++ b/hw/drivers/sensors/lis2dh12/src/lis2dh12.c
@@ -30,7 +30,7 @@
 #include "lis2dh12/lis2dh12.h"
 #include "lis2dh12_priv.h"
 #include "hal/hal_gpio.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -56,10 +56,11 @@ STATS_NAME_END(lis2dh12_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lis2dh12_stat_section) g_lis2dh12stats;
 
-#define LOG_MODULE_LIS2DH12    (212)
-#define LIS2DH12_INFO(...)     LOG_INFO(&_log, LOG_MODULE_LIS2DH12, __VA_ARGS__)
-#define LIS2DH12_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_LIS2DH12, __VA_ARGS__)
-static struct log _log;
+#define LIS2DH12_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LIS2DH12_LOG_MODULE), __VA_ARGS__)
+#else
+#define LIS2DH12_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int lis2dh12_sensor_read(struct sensor *, sensor_type_t,
@@ -115,7 +116,8 @@ lis2dh12_i2c_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DH12_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        LIS2DH12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_lis2dh12stats, read_errors);
         goto err;
     }
@@ -125,7 +127,8 @@ lis2dh12_i2c_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DH12_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, addr);
+        LIS2DH12_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     data_struct.address, addr);
         STATS_INC(g_lis2dh12stats, read_errors);
         goto err;
     }
@@ -176,7 +179,7 @@ lis2dh12_spi_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     retval = hal_spi_tx_val(itf->si_num, addr);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DH12_ERR("SPI_%u register write failed addr:0x%02X\n",
+        LIS2DH12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                      itf->si_num, addr);
         STATS_INC(g_lis2dh12stats, read_errors);
         goto err;
@@ -187,7 +190,7 @@ lis2dh12_spi_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         retval = hal_spi_tx_val(itf->si_num, 0x55);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DH12_ERR("SPI_%u read failed addr:0x%02X\n",
+            LIS2DH12_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
                          itf->si_num, addr);
             STATS_INC(g_lis2dh12stats, read_errors);
             goto err;
@@ -240,7 +243,8 @@ lis2dh12_i2c_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DH12_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        LIS2DH12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_lis2dh12stats, write_errors);
         goto err;
     }
@@ -283,7 +287,7 @@ lis2dh12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     rc = hal_spi_tx_val(itf->si_num, addr);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DH12_ERR("SPI_%u register write failed addr:0x%02X\n",
+        LIS2DH12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                      itf->si_num, addr);
         STATS_INC(g_lis2dh12stats, write_errors);
         goto err;
@@ -294,7 +298,7 @@ lis2dh12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         rc = hal_spi_tx_val(itf->si_num, payload[i]);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DH12_ERR("SPI_%u write failed addr:0x%02X\n",
+            LIS2DH12_LOG(ERROR, "SPI_%u write failed addr:0x%02X\n",
                          itf->si_num, addr);
             STATS_INC(g_lis2dh12stats, write_errors);
             goto err;
@@ -489,7 +493,7 @@ lis2dh12_set_full_scale(struct sensor_itf *itf, uint8_t fs)
     uint8_t reg;
 
     if (fs > LIS2DH12_FS_16G) {
-        LIS2DH12_ERR("Invalid full scale value\n");
+        LIS2DH12_LOG(ERROR, "Invalid full scale value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -579,7 +583,7 @@ lis2dh12_set_rate(struct sensor_itf *itf, uint8_t rate)
     uint8_t reg;
 
     if (rate > LIS2DH12_DATA_RATE_HN_1344HZ_L_5376HZ) {
-        LIS2DH12_ERR("Invalid rate value\n");
+        LIS2DH12_LOG(ERROR, "Invalid rate value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -883,8 +887,6 @@ lis2dh12_init(struct os_dev *dev, void *arg)
 
     lis2dh12->cfg.lc_s_mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &lis2dh12->sensor;
 
     /* Initialise the stats entry */
diff --git a/hw/drivers/sensors/lis2dh12/syscfg.yml b/hw/drivers/sensors/lis2dh12/syscfg.yml
index 4156514c7a..334a2cb548 100644
--- a/hw/drivers/sensors/lis2dh12/syscfg.yml
+++ b/hw/drivers/sensors/lis2dh12/syscfg.yml
@@ -21,3 +21,6 @@ syscfg.defs:
     LIS2DH12_ITF_LOCK_TMO:
         description: 'LIS2DH12 interface lock timeout in milliseconds'
         value: 1000
+    LIS2DH12_LOG_MODULE:
+        description: 'Numeric module ID to use for LIS2DH12 log messages'
+        value: 110
diff --git a/hw/drivers/sensors/lis2ds12/pkg.yml b/hw/drivers/sensors/lis2ds12/pkg.yml
index b281a61357..595b74c454 100644
--- a/hw/drivers/sensors/lis2ds12/pkg.yml
+++ b/hw/drivers/sensors/lis2ds12/pkg.yml
@@ -29,7 +29,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/lis2ds12/src/lis2ds12.c b/hw/drivers/sensors/lis2ds12/src/lis2ds12.c
index 4bf0e3ffdb..2ccc8852af 100644
--- a/hw/drivers/sensors/lis2ds12/src/lis2ds12.c
+++ b/hw/drivers/sensors/lis2ds12/src/lis2ds12.c
@@ -81,10 +81,11 @@ STATS_NAME_END(lis2ds12_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lis2ds12_stat_section) g_lis2ds12stats;
 
-#define LOG_MODULE_LIS2DS12    (212)
-#define LIS2DS12_INFO(...)     LOG_INFO(&_log, LOG_MODULE_LIS2DS12, __VA_ARGS__)
-#define LIS2DS12_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_LIS2DS12, __VA_ARGS__)
-static struct log _log;
+#define LIS2DS12_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LIS2DS12_LOG_MODULE), __VA_ARGS__)
+#else
+#define LIS2DS12_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int lis2ds12_sensor_read(struct sensor *, sensor_type_t,
@@ -143,7 +144,8 @@ lis2ds12_i2c_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DS12_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        LIS2DS12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_lis2ds12stats, write_errors);
         goto err;
     }
@@ -186,7 +188,7 @@ lis2ds12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     rc = hal_spi_tx_val(itf->si_num, addr);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DS12_ERR("SPI_%u register write failed addr:0x%02X\n",
+        LIS2DS12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                      itf->si_num, addr);
         STATS_INC(g_lis2ds12stats, write_errors);
         goto err;
@@ -197,7 +199,7 @@ lis2ds12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         rc = hal_spi_tx_val(itf->si_num, payload[i]);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DS12_ERR("SPI_%u write failed addr:0x%02X:0x%02X\n",
+            LIS2DS12_LOG(ERROR, "SPI_%u write failed addr:0x%02X:0x%02X\n",
                          itf->si_num, addr);
             STATS_INC(g_lis2ds12stats, write_errors);
             goto err;
@@ -264,7 +266,8 @@ lis2ds12_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DS12_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        LIS2DS12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     itf->si_addr);
         STATS_INC(g_lis2ds12stats, write_errors);
         return rc;
     }
@@ -276,7 +279,8 @@ lis2ds12_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        LIS2DS12_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
+        LIS2DS12_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     itf->si_addr, reg);
         STATS_INC(g_lis2ds12stats, read_errors);
     }
 
@@ -309,8 +313,8 @@ lis2ds12_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
 
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DS12_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        LIS2DS12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                     itf->si_num, reg);
         STATS_INC(g_lis2ds12stats, read_errors);
         goto err;
     }
@@ -320,8 +324,8 @@ lis2ds12_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DS12_ERR("SPI_%u read failed addr:0x%02X\n",
-                       itf->si_num, reg);
+            LIS2DS12_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                         itf->si_num, reg);
             STATS_INC(g_lis2ds12stats, read_errors);
             goto err;
         }
@@ -521,7 +525,7 @@ lis2ds12_set_full_scale(struct sensor_itf *itf, uint8_t fs)
     uint8_t reg;
 
     if (fs > LIS2DS12_FS_16G) {
-        LIS2DS12_ERR("Invalid full scale value\n");
+        LIS2DS12_LOG(ERROR, "Invalid full scale value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -586,7 +590,7 @@ lis2ds12_set_rate(struct sensor_itf *itf, uint8_t rate)
 
     // TODO probably not the best check for me
     if (rate > LIS2DS12_DATA_RATE_LP_10BIT_400HZ) {
-        LIS2DS12_ERR("Invalid rate value\n");
+        LIS2DS12_LOG(ERROR, "Invalid rate value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -1834,7 +1838,7 @@ init_intpin(struct lis2ds12 *lis2ds12, hal_gpio_irq_handler_t handler,
     }
 
     if (pin < 0) {
-        LIS2DS12_ERR("Interrupt pin not configured\n");
+        LIS2DS12_LOG(ERROR, "Interrupt pin not configured\n");
         return SYS_EINVAL;
     }
 
@@ -1850,7 +1854,7 @@ init_intpin(struct lis2ds12 *lis2ds12, hal_gpio_irq_handler_t handler,
                            trig,
                            HAL_GPIO_PULL_NONE);
     if (rc != 0) {
-        LIS2DS12_ERR("Failed to initialise interrupt pin %d\n", pin);
+        LIS2DS12_LOG(ERROR, "Failed to initialise interrupt pin %d\n", pin);
         return rc;
     } 
 
@@ -2392,7 +2396,7 @@ lis2ds12_sensor_handle_interrupt(struct sensor *sensor)
 
     rc = lis2ds12_clear_int(itf, int_src);
     if (rc) {
-        LIS2DS12_ERR("Could not read int src err=0x%02x\n", rc);
+        LIS2DS12_LOG(ERROR, "Could not read int src err=0x%02x\n", rc);
         return rc;
     }
 
@@ -2476,8 +2480,6 @@ lis2ds12_init(struct os_dev *dev, void *arg)
 
     lis2ds12->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &lis2ds12->sensor;
 
     /* Initialise the stats entry */
diff --git a/hw/drivers/sensors/lis2ds12/syscfg.yml b/hw/drivers/sensors/lis2ds12/syscfg.yml
index f4b64e3a20..4dc310b690 100644
--- a/hw/drivers/sensors/lis2ds12/syscfg.yml
+++ b/hw/drivers/sensors/lis2ds12/syscfg.yml
@@ -44,3 +44,6 @@ syscfg.defs:
     LIS2DS12_ITF_LOCK_TMO:
         description: 'LIS2DS12 interface lock timeout in milliseconds'
         value: 1000
+    LIS2DS12_LOG_MODULE:
+        description: 'Numeric module ID to use for LIS2DS12 log messages'
+        value: 212
diff --git a/hw/drivers/sensors/lis2dw12/pkg.yml b/hw/drivers/sensors/lis2dw12/pkg.yml
index f188c49246..d5634bdeb7 100644
--- a/hw/drivers/sensors/lis2dw12/pkg.yml
+++ b/hw/drivers/sensors/lis2dw12/pkg.yml
@@ -29,7 +29,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
index fe82314346..a891ada703 100644
--- a/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
+++ b/hw/drivers/sensors/lis2dw12/src/lis2dw12.c
@@ -30,7 +30,7 @@
 #include "lis2dw12/lis2dw12.h"
 #include "lis2dw12_priv.h"
 #include "hal/hal_gpio.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -148,10 +148,11 @@ STATS_NAME_END(lis2dw12_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lis2dw12_stat_section) g_lis2dw12stats;
 
-#define LOG_MODULE_LIS2DW12    (212)
-#define LIS2DW12_INFO(...)     LOG_INFO(&_log, LOG_MODULE_LIS2DW12, __VA_ARGS__)
-#define LIS2DW12_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_LIS2DW12, __VA_ARGS__)
-static struct log _log;
+#define LIS2DW12_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LIS2DW12_LOG_MODULE), __VA_ARGS__)
+#else
+#define LIS2DW12_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int lis2dw12_sensor_read(struct sensor *, sensor_type_t,
@@ -210,7 +211,8 @@ lis2dw12_i2c_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DW12_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        LIS2DW12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_lis2dw12stats, write_errors);
         goto err;
     }
@@ -253,7 +255,7 @@ lis2dw12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
     rc = hal_spi_tx_val(itf->si_num, addr);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DW12_ERR("SPI_%u register write failed addr:0x%02X\n",
+        LIS2DW12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
                      itf->si_num, addr);
         STATS_INC(g_lis2dw12stats, write_errors);
         goto err;
@@ -264,7 +266,7 @@ lis2dw12_spi_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *payload,
         rc = hal_spi_tx_val(itf->si_num, payload[i]);
         if (rc == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DW12_ERR("SPI_%u write failed addr:0x%02X:0x%02X\n",
+            LIS2DW12_LOG(ERROR, "SPI_%u write failed addr:0x%02X:0x%02X\n",
                          itf->si_num, addr);
             STATS_INC(g_lis2dw12stats, write_errors);
             goto err;
@@ -338,7 +340,8 @@ lis2dw12_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LIS2DW12_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        LIS2DW12_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     itf->si_addr);
         STATS_INC(g_lis2dw12stats, write_errors);
         return rc;
     }
@@ -350,7 +353,8 @@ lis2dw12_i2c_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        LIS2DW12_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
+        LIS2DW12_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     itf->si_addr, reg);
         STATS_INC(g_lis2dw12stats, read_errors);
     }
 
@@ -383,8 +387,8 @@ lis2dw12_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
 
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        LIS2DW12_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        LIS2DW12_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                     itf->si_num, reg);
         STATS_INC(g_lis2dw12stats, read_errors);
         goto err;
     }
@@ -394,8 +398,8 @@ lis2dw12_spi_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            LIS2DW12_ERR("SPI_%u read failed addr:0x%02X\n",
-                       itf->si_num, reg);
+            LIS2DW12_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                         itf->si_num, reg);
             STATS_INC(g_lis2dw12stats, read_errors);
             goto err;
         }
@@ -595,7 +599,7 @@ lis2dw12_set_full_scale(struct sensor_itf *itf, uint8_t fs)
     uint8_t reg;
 
     if (fs > LIS2DW12_FS_16G) {
-        LIS2DW12_ERR("Invalid full scale value\n");
+        LIS2DW12_LOG(ERROR, "Invalid full scale value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -659,7 +663,7 @@ lis2dw12_set_rate(struct sensor_itf *itf, uint8_t rate)
     uint8_t reg;
 
     if (rate > LIS2DW12_DATA_RATE_1600HZ) {
-        LIS2DW12_ERR("Invalid rate value\n");
+        LIS2DW12_LOG(ERROR, "Invalid rate value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -2220,7 +2224,7 @@ init_intpin(struct lis2dw12 *lis2dw12, hal_gpio_irq_handler_t handler,
     }
 
     if (pin < 0) {
-        LIS2DW12_ERR("Interrupt pin not configured\n");
+        LIS2DW12_LOG(ERROR, "Interrupt pin not configured\n");
         return SYS_EINVAL;
     }
 
@@ -2236,7 +2240,7 @@ init_intpin(struct lis2dw12 *lis2dw12, hal_gpio_irq_handler_t handler,
                            trig,
                            HAL_GPIO_PULL_NONE);
     if (rc != 0) {
-        LIS2DW12_ERR("Failed to initialise interrupt pin %d\n", pin);
+        LIS2DW12_LOG(ERROR, "Failed to initialise interrupt pin %d\n", pin);
         return rc;
     }
 
@@ -2831,7 +2835,7 @@ lis2dw12_sensor_handle_interrupt(struct sensor *sensor)
          */
         rc = lis2dw12_get_int_status(itf, &int_status);
         if (rc) {
-            LIS2DW12_ERR("Could not read int status err=0x%02x\n", rc);
+            LIS2DW12_LOG(ERROR, "Could not read int status err=0x%02x\n", rc);
             return rc;
         }
 
@@ -2852,7 +2856,7 @@ lis2dw12_sensor_handle_interrupt(struct sensor *sensor)
 
     rc = lis2dw12_get_sixd_src(itf, &sixd_src);
     if (rc) {
-        LIS2DW12_ERR("Could not read sixd src err=0x%02x\n", rc);
+        LIS2DW12_LOG(ERROR, "Could not read sixd src err=0x%02x\n", rc);
         goto err;
     }
 
@@ -2934,7 +2938,7 @@ lis2dw12_sensor_handle_interrupt(struct sensor *sensor)
 
     rc = lis2dw12_clear_int(itf, &int_src);
     if (rc) {
-        LIS2DW12_ERR("Could not read int src err=0x%02x\n", rc);
+        LIS2DW12_LOG(ERROR, "Could not read int src err=0x%02x\n", rc);
         return rc;
     }
 
@@ -3055,8 +3059,6 @@ lis2dw12_init(struct os_dev *dev, void *arg)
 
     lis2dw12->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &lis2dw12->sensor;
 
     /* Initialise the stats entry */
diff --git a/hw/drivers/sensors/lis2dw12/syscfg.yml b/hw/drivers/sensors/lis2dw12/syscfg.yml
index 794e3c7df0..3d31eb88d2 100644
--- a/hw/drivers/sensors/lis2dw12/syscfg.yml
+++ b/hw/drivers/sensors/lis2dw12/syscfg.yml
@@ -47,3 +47,6 @@ syscfg.defs:
     LIS2DW12_ITF_LOCK_TMO:
         description: 'LIS2DW12 interface lock timeout in milliseconds'
         value: 1000
+    LIS2DW12_LOG_MODULE:
+        description: 'Numeric module ID to use for LIS2DW12 log messages'
+        value: 213
diff --git a/hw/drivers/sensors/lps33hw/pkg.yml b/hw/drivers/sensors/lps33hw/pkg.yml
index a9aad3b42e..ea9a608032 100644
--- a/hw/drivers/sensors/lps33hw/pkg.yml
+++ b/hw/drivers/sensors/lps33hw/pkg.yml
@@ -33,10 +33,10 @@ pkg.deps:
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.LPS33HW_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/lps33hw/src/lps33hw.c b/hw/drivers/sensors/lps33hw/src/lps33hw.c
index 38268d47e0..d19aff53c2 100644
--- a/hw/drivers/sensors/lps33hw/src/lps33hw.c
+++ b/hw/drivers/sensors/lps33hw/src/lps33hw.c
@@ -31,7 +31,7 @@
 #include "sensor/temperature.h"
 #include "lps33hw/lps33hw.h"
 #include "lps33hw_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -57,10 +57,11 @@ STATS_NAME_END(lps33hw_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lps33hw_stat_section) g_lps33hwstats;
 
-#define LOG_MODULE_LPS33HW    (33)
-#define LPS33HW_INFO(...)     LOG_INFO(&_log, LOG_MODULE_LPS33HW, __VA_ARGS__)
-#define LPS33HW_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_LPS33HW, __VA_ARGS__)
-static struct log _log;
+#define LPS33HW_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LPS33HW_LOG_MODULE), __VA_ARGS__)
+#else
+#define LPS33HW_LOG(lvl_, ...)
+#endif
 
 #define LPS33HW_PRESS_OUT_DIV (40.96)
 #define LPS33HW_TEMP_OUT_DIV (100.0)
@@ -181,8 +182,9 @@ lps33hw_i2c_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value)
                               OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        LPS33HW_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
-                       itf->si_addr, reg, value);
+        LPS33HW_LOG(ERROR,
+                    "Failed to write to 0x%02X:0x%02X with value 0x%02X\n",
+                    itf->si_addr, reg, value);
         STATS_INC(g_lps33hwstats, read_errors);
     }
 
@@ -211,8 +213,8 @@ lps33hw_spi_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value)
     rc = hal_spi_tx_val(itf->si_num, reg & ~LPS33HW_SPI_READ_CMD_BIT);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        LPS33HW_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        LPS33HW_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_lps33hwstats, write_errors);
         goto err;
     }
@@ -221,8 +223,8 @@ lps33hw_spi_set_reg(struct sensor_itf *itf, uint8_t reg, uint8_t value)
     rc = hal_spi_tx_val(itf->si_num, value);
     if (rc == 0xFFFF) {
         rc = SYS_EINVAL;
-        LPS33HW_ERR("SPI_%u write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        LPS33HW_LOG(ERROR, "SPI_%u write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_lps33hwstats, write_errors);
         goto err;
     }
@@ -296,8 +298,8 @@ lps33hw_spi_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
     retval = hal_spi_tx_val(itf->si_num, reg | LPS33HW_SPI_READ_CMD_BIT);
     if (retval == 0xFFFF) {
         rc = SYS_EINVAL;
-        LPS33HW_ERR("SPI_%u register write failed addr:0x%02X\n",
-                   itf->si_num, reg);
+        LPS33HW_LOG(ERROR, "SPI_%u register write failed addr:0x%02X\n",
+                    itf->si_num, reg);
         STATS_INC(g_lps33hwstats, read_errors);
         goto err;
     }
@@ -307,8 +309,8 @@ lps33hw_spi_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
         retval = hal_spi_tx_val(itf->si_num, 0);
         if (retval == 0xFFFF) {
             rc = SYS_EINVAL;
-            LPS33HW_ERR("SPI_%u read failed addr:0x%02X\n",
-                       itf->si_num, reg);
+            LPS33HW_LOG(ERROR, "SPI_%u read failed addr:0x%02X\n",
+                        itf->si_num, reg);
             STATS_INC(g_lps33hwstats, read_errors);
             goto err;
         }
@@ -350,7 +352,8 @@ lps33hw_i2c_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LPS33HW_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        LPS33HW_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    itf->si_addr);
         STATS_INC(g_lps33hwstats, write_errors);
         return rc;
     }
@@ -362,8 +365,9 @@ lps33hw_i2c_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
                              (OS_TICKS_PER_SEC / 10) * size, 1);
 
     if (rc) {
-         LPS33HW_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
-         STATS_INC(g_lps33hwstats, read_errors);
+        LPS33HW_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    itf->si_addr, reg);
+        STATS_INC(g_lps33hwstats, read_errors);
     }
     return rc;
 }
@@ -631,7 +635,7 @@ lps33hw_disable_interrupt(struct sensor *sensor)
 static int
 lps33hw_sensor_handle_interrupt(struct sensor *sensor)
 {
-    LPS33HW_ERR("Unhandled interrupt\n");
+    LPS33HW_LOG(ERROR, "Unhandled interrupt\n");
     return 0;
 }
 
@@ -871,8 +875,6 @@ lps33hw_init(struct os_dev *dev, void *arg)
     sensor = &lps->sensor;
     lps->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     /* Initialise the stats entry */
     rc = stats_init(
         STATS_HDR(g_lps33hwstats),
@@ -996,7 +998,7 @@ lps33hw_read_interrupt_handler(void *arg)
 
     rc = lps33hw_get_pressure(itf, &spd.spd_press);
     if (rc) {
-        LPS33HW_ERR("Get pressure failed\n");
+        LPS33HW_LOG(ERROR, "Get pressure failed\n");
         spd.spd_press_is_valid = 0;
     } else {
         spd.spd_press_is_valid = 1;
diff --git a/hw/drivers/sensors/lps33hw/syscfg.yml b/hw/drivers/sensors/lps33hw/syscfg.yml
index c932a30bc3..dd358dba50 100644
--- a/hw/drivers/sensors/lps33hw/syscfg.yml
+++ b/hw/drivers/sensors/lps33hw/syscfg.yml
@@ -35,3 +35,6 @@ syscfg.defs:
     LPS33HW_ITF_LOCK_TMO:
         description: 'LPS33HW interface lock timeout in milliseconds'
         value: 1000
+    LPS33HW_LOG_MODULE:
+        description: 'Numeric module ID to use for LPS33HW log messages'
+        value: 133
diff --git a/hw/drivers/sensors/lsm303dlhc/pkg.yml b/hw/drivers/sensors/lsm303dlhc/pkg.yml
index ba45cdff9a..3b96f9a280 100644
--- a/hw/drivers/sensors/lsm303dlhc/pkg.yml
+++ b/hw/drivers/sensors/lsm303dlhc/pkg.yml
@@ -31,8 +31,8 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
diff --git a/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c b/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
index f9840f5a27..431ef93608 100644
--- a/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
+++ b/hw/drivers/sensors/lsm303dlhc/src/lsm303dlhc.c
@@ -28,7 +28,7 @@
 #include "sensor/mag.h"
 #include "lsm303dlhc/lsm303dlhc.h"
 #include "lsm303dlhc_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 
 /* Define the stats section and records */
@@ -66,10 +66,11 @@ STATS_NAME_END(lsm303dlhc_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(lsm303dlhc_stat_section) g_lsm303dlhcstats;
 
-#define LOG_MODULE_LSM303DLHC (303)
-#define LSM303DLHC_INFO(...)  LOG_INFO(&_log, LOG_MODULE_LSM303DLHC, __VA_ARGS__)
-#define LSM303DLHC_ERR(...)   LOG_ERROR(&_log, LOG_MODULE_LSM303DLHC, __VA_ARGS__)
-static struct log _log;
+#define LSM303DLHC_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(LSM303DLHC_LOG_MODULE), __VA_ARGS__)
+#else
+#define LSM303DLHC_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int lsm303dlhc_sensor_read(struct sensor *, sensor_type_t,
@@ -113,7 +114,8 @@ lsm303dlhc_write8(struct sensor_itf *itf, uint8_t addr, uint8_t reg,
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LSM303DLHC_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
+        LSM303DLHC_LOG(ERROR,
+                       "Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
                        addr, reg, value);
         STATS_INC(g_lsm303dlhcstats, errors);
     }
@@ -156,7 +158,7 @@ lsm303dlhc_read8(struct sensor_itf *itf, uint8_t addr, uint8_t reg,
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LSM303DLHC_ERR("I2C access failed at address 0x%02X\n", addr);
+        LSM303DLHC_LOG(ERROR, "I2C access failed at address 0x%02X\n", addr);
         STATS_INC(g_lsm303dlhcstats, errors);
         goto err;
     }
@@ -167,7 +169,8 @@ lsm303dlhc_read8(struct sensor_itf *itf, uint8_t addr, uint8_t reg,
                              OS_TICKS_PER_SEC / 10, 1);
     *value = payload;
     if (rc) {
-        LSM303DLHC_ERR("Failed to read from 0x%02X:0x%02X\n", addr, reg);
+        LSM303DLHC_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                       addr, reg);
         STATS_INC(g_lsm303dlhcstats, errors);
     }
 
@@ -212,7 +215,7 @@ lsm303dlhc_read48(struct sensor_itf *itf, uint8_t addr, uint8_t reg,
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        LSM303DLHC_ERR("I2C access failed at address 0x%02X\n", addr);
+        LSM303DLHC_LOG(ERROR, "I2C access failed at address 0x%02X\n", addr);
         STATS_INC(g_lsm303dlhcstats, errors);
         goto err;
     }
@@ -224,7 +227,8 @@ lsm303dlhc_read48(struct sensor_itf *itf, uint8_t addr, uint8_t reg,
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        LSM303DLHC_ERR("Failed to read from 0x%02X:0x%02X\n", addr, reg);
+        LSM303DLHC_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                       addr, reg);
         STATS_INC(g_lsm303dlhcstats, errors);
     }
 
@@ -261,8 +265,6 @@ lsm303dlhc_init(struct os_dev *dev, void *arg)
 
     lsm->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &lsm->sensor;
 
     /* Initialise the stats entry */
@@ -442,7 +444,8 @@ lsm303dlhc_sensor_read(struct sensor *sensor, sensor_type_t type,
                 mg_lsb = 0.012F;
                 break;
             default:
-                LSM303DLHC_ERR("Unknown accel range: 0x%02X. Assuming +/-2G.\n",
+                LSM303DLHC_LOG(
+                    ERROR, "Unknown accel range: 0x%02X. Assuming +/-2G.\n",
                     lsm->cfg.accel_range);
                 mg_lsb = 0.001F;
                 break;
@@ -517,8 +520,9 @@ lsm303dlhc_sensor_read(struct sensor *sensor, sensor_type_t type,
                 gauss_lsb_z = 205;
                 break;
             default:
-                LSM303DLHC_ERR("Unknown mag gain: 0x%02X. Assuming +/-1.3g.\n",
-                    lsm->cfg.mag_gain);
+                LSM303DLHC_LOG(ERROR,
+                               "Unknown mag gain: 0x%02X. Assuming +/-1.3g.\n",
+                               lsm->cfg.mag_gain);
                 gauss_lsb_xy = 1100;
                 gauss_lsb_z = 980;
                 break;
diff --git a/hw/drivers/sensors/lsm303dlhc/syscfg.yml b/hw/drivers/sensors/lsm303dlhc/syscfg.yml
index 06f9780f0c..981725a588 100644
--- a/hw/drivers/sensors/lsm303dlhc/syscfg.yml
+++ b/hw/drivers/sensors/lsm303dlhc/syscfg.yml
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -21,3 +20,6 @@ syscfg.defs:
     LSM303DLHC_ITF_LOCK_TMO:
         description: 'LSM303DLHC interface lock timeout in milliseconds'
         value: 1000
+    LSM303DLHC_LOG_MODULE:
+        description: 'Numeric module ID to use for LSM303DLHC log messages'
+        value: 195
diff --git a/hw/drivers/sensors/mpu6050/pkg.yml b/hw/drivers/sensors/mpu6050/pkg.yml
index 331dbf24a2..2355a26d33 100644
--- a/hw/drivers/sensors/mpu6050/pkg.yml
+++ b/hw/drivers/sensors/mpu6050/pkg.yml
@@ -31,7 +31,7 @@ pkg.deps:
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/mpu6050/src/mpu6050.c b/hw/drivers/sensors/mpu6050/src/mpu6050.c
index d715204e60..07b2221a13 100644
--- a/hw/drivers/sensors/mpu6050/src/mpu6050.c
+++ b/hw/drivers/sensors/mpu6050/src/mpu6050.c
@@ -28,7 +28,7 @@
 #include "sensor/gyro.h"
 #include "mpu6050/mpu6050.h"
 #include "mpu6050_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -47,10 +47,11 @@ STATS_NAME_END(mpu6050_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(mpu6050_stat_section) g_mpu6050stats;
 
-#define LOG_MODULE_MPU6050    (6050)
-#define MPU6050_INFO(...)     LOG_INFO(&_log, LOG_MODULE_MPU6050, __VA_ARGS__)
-#define MPU6050_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_MPU6050, __VA_ARGS__)
-static struct log _log;
+#define MPU6050_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(MPU6050_LOG_MODULE), __VA_ARGS__)
+#else
+#define MPU6050_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int mpu6050_sensor_read(struct sensor *, sensor_type_t,
@@ -93,8 +94,9 @@ mpu6050_write8(struct sensor_itf *itf, uint8_t reg, uint32_t value)
                               OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        MPU6050_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
-                       itf->si_addr, reg, value);
+        MPU6050_LOG(ERROR,
+                    "Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
+                    itf->si_addr, reg, value);
         STATS_INC(g_mpu6050stats, read_errors);
     }
 
@@ -132,7 +134,8 @@ mpu6050_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        MPU6050_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        MPU6050_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    itf->si_addr);
         STATS_INC(g_mpu6050stats, write_errors);
         return rc;
     }
@@ -143,8 +146,9 @@ mpu6050_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-         MPU6050_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
-         STATS_INC(g_mpu6050stats, read_errors);
+        MPU6050_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    itf->si_addr, reg);
+        STATS_INC(g_mpu6050stats, read_errors);
     }
 
     sensor_itf_unlock(itf);
@@ -181,7 +185,8 @@ mpu6050_read48(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 0);
     if (rc) {
-        MPU6050_ERR("I2C access failed at address 0x%02X\n", itf->si_addr);
+        MPU6050_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                    itf->si_addr);
         STATS_INC(g_mpu6050stats, write_errors);
         return rc;
     }
@@ -193,8 +198,9 @@ mpu6050_read48(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer)
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-         MPU6050_ERR("Failed to read from 0x%02X:0x%02X\n", itf->si_addr, reg);
-         STATS_INC(g_mpu6050stats, read_errors);
+        MPU6050_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                    itf->si_addr, reg);
+        STATS_INC(g_mpu6050stats, read_errors);
     }
 
     sensor_itf_unlock(itf);
@@ -401,8 +407,6 @@ mpu6050_init(struct os_dev *dev, void *arg)
 
     mpu->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &mpu->sensor;
 
     /* Initialise the stats entry */
diff --git a/hw/drivers/sensors/mpu6050/syscfg.yml b/hw/drivers/sensors/mpu6050/syscfg.yml
index 805d75f516..429c6fe647 100644
--- a/hw/drivers/sensors/mpu6050/syscfg.yml
+++ b/hw/drivers/sensors/mpu6050/syscfg.yml
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -21,3 +20,6 @@ syscfg.defs:
     MPU6050_ITF_LOCK_TMO:
         description: 'MPU6050 interface lock timeout in milliseconds'
         value: 1000
+    MPU6050_LOG_MODULE:
+        description: 'Numeric module ID to use for MPU6050 log messages'
+        value: 115
diff --git a/hw/drivers/sensors/ms5837/pkg.yml b/hw/drivers/sensors/ms5837/pkg.yml
index 0e5dc1980a..784a648859 100644
--- a/hw/drivers/sensors/ms5837/pkg.yml
+++ b/hw/drivers/sensors/ms5837/pkg.yml
@@ -31,7 +31,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/ms5837/src/ms5837.c b/hw/drivers/sensors/ms5837/src/ms5837.c
index 9781712c89..5691fb8cc2 100644
--- a/hw/drivers/sensors/ms5837/src/ms5837.c
+++ b/hw/drivers/sensors/ms5837/src/ms5837.c
@@ -30,7 +30,7 @@
 #include "sensor/pressure.h"
 #include "ms5837_priv.h"
 #include "console/console.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -60,10 +60,11 @@ STATS_NAME_END(ms5837_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(ms5837_stat_section) g_ms5837stats;
 
-#define LOG_MODULE_MS5837    (5837)
-#define MS5837_INFO(...)     LOG_INFO(&_log, LOG_MODULE_MS5837, __VA_ARGS__)
-#define MS5837_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_MS5837, __VA_ARGS__)
-static struct log _log;
+#define MS5837_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(MS5837_LOG_MODULE), __VA_ARGS__)
+#else
+#define MS5837_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int ms5837_sensor_read(struct sensor *, sensor_type_t,
@@ -101,8 +102,6 @@ ms5837_init(struct os_dev *dev, void *arg)
 
     ms5837 = (struct ms5837 *)dev;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &ms5837->sensor;
 
     itf = SENSOR_GET_ITF(sensor);
@@ -341,7 +340,7 @@ ms5837_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5837_ERR("I2C write command write failed at address 0x%02X\n",
+        MS5837_LOG(ERROR, "I2C write command write failed at address 0x%02X\n",
                    data_struct.address);
         STATS_INC(g_ms5837stats, write_errors);
     }
@@ -385,7 +384,7 @@ ms5837_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Command write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5837_ERR("I2C read command write failed at address 0x%02X\n",
+        MS5837_LOG(ERROR, "I2C read command write failed at address 0x%02X\n",
                    data_struct.address);
         STATS_INC(g_ms5837stats, write_errors);
         goto err;
@@ -396,7 +395,8 @@ ms5837_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5837_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, addr);
+        MS5837_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                   data_struct.address, addr);
         STATS_INC(g_ms5837stats, read_errors);
         goto err;
     }
@@ -440,7 +440,7 @@ ms5837_read_eeprom(struct sensor_itf *itf, uint16_t *coeff)
     rc = ms5837_crc_check(payload, (payload[MS5837_IDX_CRC] & 0xF000) >> 12);
     if (rc) {
         rc = SYS_EINVAL;
-        MS5837_ERR("Failure in CRC, 0x%02X\n",
+        MS5837_LOG(ERROR, "Failure in CRC, 0x%02X\n",
                    payload[MS5837_IDX_CRC] &  0xF000 >> 12);
         STATS_INC(g_ms5837stats, eeprom_crc_errors);
         goto err;
diff --git a/hw/drivers/sensors/ms5837/syscfg.yml b/hw/drivers/sensors/ms5837/syscfg.yml
index 7cc9b7156b..b9272cb0ac 100644
--- a/hw/drivers/sensors/ms5837/syscfg.yml
+++ b/hw/drivers/sensors/ms5837/syscfg.yml
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -17,7 +16,9 @@
 # under the License.
 #
 
-syscfg.defs:
     MS5837_ITF_LOCK_TMO:
         description: 'MS5837 interface lock timeout in milliseconds'
         value: 1000
+    MS5837_LOG_MODULE:
+        description: 'Numeric module ID to use for MS5837 log messages'
+        value: 140
diff --git a/hw/drivers/sensors/ms5840/pkg.yml b/hw/drivers/sensors/ms5840/pkg.yml
index c75b2054c8..d990ce0f00 100644
--- a/hw/drivers/sensors/ms5840/pkg.yml
+++ b/hw/drivers/sensors/ms5840/pkg.yml
@@ -31,7 +31,7 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
diff --git a/hw/drivers/sensors/ms5840/src/ms5840.c b/hw/drivers/sensors/ms5840/src/ms5840.c
index b1ba2aa453..b15f3740bb 100644
--- a/hw/drivers/sensors/ms5840/src/ms5840.c
+++ b/hw/drivers/sensors/ms5840/src/ms5840.c
@@ -33,7 +33,7 @@
 #include "ms5840_priv.h"
 #include "os/os_cputime.h"
 #include "console/console.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -63,10 +63,11 @@ STATS_NAME_END(ms5840_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(ms5840_stat_section) g_ms5840stats;
 
-#define LOG_MODULE_MS5840    (5840)
-#define MS5840_INFO(...)     LOG_INFO(&_log, LOG_MODULE_MS5840, __VA_ARGS__)
-#define MS5840_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_MS5840, __VA_ARGS__)
-static struct log _log;
+#define MS5840_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(MS5840_LOG_MODULE), __VA_ARGS__)
+#else
+#define MS5840_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int ms5840_sensor_read(struct sensor *, sensor_type_t,
@@ -104,8 +105,6 @@ ms5840_init(struct os_dev *dev, void *arg)
 
     ms5840 = (struct ms5840 *)dev;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &ms5840->sensor;
 
     itf = SENSOR_GET_ITF(sensor);
@@ -342,7 +341,7 @@ ms5840_writelen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Register write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5840_ERR("I2C write command write failed at address 0x%02X\n",
+        MS5840_LOG(ERROR, "I2C write command write failed at address 0x%02X\n",
                    data_struct.address);
         STATS_INC(g_ms5840stats, write_errors);
     }
@@ -386,7 +385,7 @@ ms5840_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     /* Command write */
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5840_ERR("I2C read command write failed at address 0x%02X\n",
+        MS5840_LOG(ERROR, "I2C read command write failed at address 0x%02X\n",
                    data_struct.address);
         STATS_INC(g_ms5840stats, write_errors);
         goto err;
@@ -397,7 +396,8 @@ ms5840_readlen(struct sensor_itf *itf, uint8_t addr, uint8_t *buffer,
     data_struct.len = len;
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        MS5840_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, addr);
+        MS5840_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                   data_struct.address, addr);
         STATS_INC(g_ms5840stats, read_errors);
         goto err;
     }
@@ -442,7 +442,7 @@ ms5840_read_eeprom(struct sensor_itf *itf, uint16_t *coeff)
     rc = ms5840_crc_check(payload, (payload[MS5840_IDX_CRC] & 0xF000) >> 12);
     if (rc) {
         rc = SYS_EINVAL;
-        MS5840_ERR("Failure in CRC, 0x%02X\n",
+        MS5840_LOG(ERROR, "Failure in CRC, 0x%02X\n",
                    payload[MS5840_IDX_CRC] &  0xF000 >> 12);
         STATS_INC(g_ms5840stats, eeprom_crc_errors);
         goto err;
diff --git a/hw/drivers/sensors/ms5840/syscfg.yml b/hw/drivers/sensors/ms5840/syscfg.yml
index 9b726b64ad..a8e2acdb14 100644
--- a/hw/drivers/sensors/ms5840/syscfg.yml
+++ b/hw/drivers/sensors/ms5840/syscfg.yml
@@ -1,4 +1,3 @@
-#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -21,3 +20,6 @@ syscfg.defs:
     MS5840_ITF_LOCK_TMO:
         description: 'MS5840 interface lock timeout in milliseconds'
         value: 1000
+    MS5840_LOG_MODULE:
+        description: 'Numeric module ID to use for MS5840 log messages'
+        value: 170
diff --git a/hw/drivers/sensors/tcs34725/pkg.yml b/hw/drivers/sensors/tcs34725/pkg.yml
index 47e4ebf85f..92049f1754 100644
--- a/hw/drivers/sensors/tcs34725/pkg.yml
+++ b/hw/drivers/sensors/tcs34725/pkg.yml
@@ -31,10 +31,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.TCS34725_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/tcs34725/src/tcs34725.c b/hw/drivers/sensors/tcs34725/src/tcs34725.c
index 446c2693e4..399dd77d2e 100644
--- a/hw/drivers/sensors/tcs34725/src/tcs34725.c
+++ b/hw/drivers/sensors/tcs34725/src/tcs34725.c
@@ -27,7 +27,7 @@
 #include "tcs34725/tcs34725.h"
 #include "tcs34725_priv.h"
 #include "sensor/color.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -58,10 +58,11 @@ STATS_NAME_END(tcs34725_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(tcs34725_stat_section) g_tcs34725stats;
 
-#define LOG_MODULE_TCS34725 (307)
-#define TCS34725_INFO(...)  LOG_INFO(&_log, LOG_MODULE_TCS34725, __VA_ARGS__)
-#define TCS34725_ERR(...)   LOG_ERROR(&_log, LOG_MODULE_TCS34725, __VA_ARGS__)
-static struct log _log;
+#define TCS34725_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(TCS34725_LOG_MODULE), __VA_ARGS__)
+#else
+#define TCS34725_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int tcs34725_sensor_read(struct sensor *, sensor_type_t,
@@ -103,8 +104,9 @@ tcs34725_write8(struct sensor_itf *itf, uint8_t reg, uint32_t value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TCS34725_ERR("Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
-                       data_struct.address, reg, value);
+        TCS34725_LOG(ERROR,
+                     "Failed to write to 0x%02X:0x%02X with value 0x%02lX\n",
+                     data_struct.address, reg, value);
         STATS_INC(g_tcs34725stats, errors);
     }
 
@@ -143,7 +145,8 @@ tcs34725_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     payload = reg | TCS34725_COMMAND_BIT;
     rc = hal_i2c_master_write(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TCS34725_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        TCS34725_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_tcs34725stats, errors);
         goto err;
     }
@@ -153,7 +156,8 @@ tcs34725_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_read(itf->si_num, &data_struct, OS_TICKS_PER_SEC / 10, 1);
     *value = payload;
     if (rc) {
-        TCS34725_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        TCS34725_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     data_struct.address, reg);
         STATS_INC(g_tcs34725stats, errors);
     }
 
@@ -196,7 +200,8 @@ tcs34725_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_t l
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TCS34725_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        TCS34725_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_tcs34725stats, errors);
         goto err;
     }
@@ -208,7 +213,8 @@ tcs34725_readlen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_t l
                              OS_TICKS_PER_SEC / 10, 1);
 
     if (rc) {
-        TCS34725_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        TCS34725_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     data_struct.address, reg);
         STATS_INC(g_tcs34725stats, errors);
         goto err;
     }
@@ -259,7 +265,8 @@ tcs34725_writelen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_t
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TCS34725_ERR("I2C access failed at address 0x%02X\n", data_struct.address);
+        TCS34725_LOG(ERROR, "I2C access failed at address 0x%02X\n",
+                     data_struct.address);
         STATS_INC(g_tcs34725stats, errors);
         goto err;
     }
@@ -270,7 +277,8 @@ tcs34725_writelen(struct sensor_itf *itf, uint8_t reg, uint8_t *buffer, uint8_t
                               OS_TICKS_PER_SEC / 10, len);
 
     if (rc) {
-        TCS34725_ERR("Failed to read from 0x%02X:0x%02X\n", data_struct.address, reg);
+        TCS34725_LOG(ERROR, "Failed to read from 0x%02X:0x%02X\n",
+                     data_struct.address, reg);
         STATS_INC(g_tcs34725stats, errors);
         goto err;
     }
@@ -361,8 +369,6 @@ tcs34725_init(struct os_dev *dev, void *arg)
 
     tcs34725->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &tcs34725->sensor;
 
     /* Initialise the stats entry */
@@ -493,7 +499,7 @@ tcs34725_set_gain(struct sensor_itf *itf, uint8_t gain)
     int rc;
 
     if (gain > TCS34725_GAIN_60X) {
-        TCS34725_ERR("Invalid gain value\n");
+        TCS34725_LOG(ERROR, "Invalid gain value\n");
         rc = SYS_EINVAL;
         goto err;
     }
diff --git a/hw/drivers/sensors/tcs34725/syscfg.yml b/hw/drivers/sensors/tcs34725/syscfg.yml
index cf82dfb1b5..7922406b45 100644
--- a/hw/drivers/sensors/tcs34725/syscfg.yml
+++ b/hw/drivers/sensors/tcs34725/syscfg.yml
@@ -33,4 +33,6 @@ syscfg.defs:
     TCS34725_ITF_LOCK_TMO:
         description: 'TCS34725 interface lock timeout in milliseconds'
         value: 1000
-
+    TCS34725_LOG_MODULE:
+        description: 'Numeric module ID to use for TCS34725 log messages'
+        value: 254
diff --git a/hw/drivers/sensors/tsl2561/pkg.yml b/hw/drivers/sensors/tsl2561/pkg.yml
index 523e9119ea..c0c8e91eee 100644
--- a/hw/drivers/sensors/tsl2561/pkg.yml
+++ b/hw/drivers/sensors/tsl2561/pkg.yml
@@ -34,10 +34,10 @@ pkg.deps:
     - "@apache-mynewt-core/kernel/os"
     - "@apache-mynewt-core/hw/hal"
     - "@apache-mynewt-core/hw/sensor"
+    - "@apache-mynewt-core/sys/log/modlog"
 
 pkg.req_apis:
     - stats
-    - log
 
 pkg.deps.TSL2561_CLI:
     - "@apache-mynewt-core/util/parse"
diff --git a/hw/drivers/sensors/tsl2561/src/tsl2561.c b/hw/drivers/sensors/tsl2561/src/tsl2561.c
index 9a165fb9e3..797153fe68 100644
--- a/hw/drivers/sensors/tsl2561/src/tsl2561.c
+++ b/hw/drivers/sensors/tsl2561/src/tsl2561.c
@@ -45,7 +45,7 @@
 #include "sensor/light.h"
 #include "tsl2561/tsl2561.h"
 #include "tsl2561_priv.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "stats/stats.h"
 #include <syscfg/syscfg.h>
 
@@ -64,10 +64,11 @@ STATS_NAME_END(tsl2561_stat_section)
 /* Global variable used to hold stats data */
 STATS_SECT_DECL(tsl2561_stat_section) g_tsl2561stats;
 
-#define LOG_MODULE_TSL2561    (2561)
-#define TSL2561_INFO(...)     LOG_INFO(&_log, LOG_MODULE_TSL2561, __VA_ARGS__)
-#define TSL2561_ERR(...)      LOG_ERROR(&_log, LOG_MODULE_TSL2561, __VA_ARGS__)
-static struct log _log;
+#define TSL2561_LOG(lvl_, ...) \
+    MODLOG_ ## lvl_(MYNEWT_VAL(TSL2561_LOG_MODULE), __VA_ARGS__)
+#else
+#define TSL2561_LOG(lvl_, ...)
+#endif
 
 /* Exports for the sensor API */
 static int tsl2561_sensor_read(struct sensor *, sensor_type_t,
@@ -100,7 +101,8 @@ tsl2561_write8(struct sensor_itf *itf, uint8_t reg, uint32_t value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TSL2561_ERR("Failed to write 0x%02X:0x%02X with value 0x%02lX\n",
+        TSL2561_LOG(ERROR,
+                    "Failed to write 0x%02X:0x%02X with value 0x%02lX\n",
                     data_struct.address, reg, value);
         STATS_INC(g_tsl2561stats, errors);
     }
@@ -130,7 +132,8 @@ tsl2561_write16(struct sensor_itf *itf, uint8_t reg, uint16_t value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TSL2561_ERR("Failed to write @0x%02X with value 0x%02X 0x%02X\n",
+        TSL2561_LOG(ERROR,
+                    "Failed to write @0x%02X with value 0x%02X 0x%02X\n",
                     reg, payload[0], payload[1]);
     }
 
@@ -161,7 +164,7 @@ tsl2561_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TSL2561_ERR("Failed to address sensor\n");
+        TSL2561_LOG(ERROR, "Failed to address sensor\n");
         goto err;
     }
 
@@ -171,7 +174,7 @@ tsl2561_read8(struct sensor_itf *itf, uint8_t reg, uint8_t *value)
                              OS_TICKS_PER_SEC / 10, 1);
     *value = payload;
     if (rc) {
-        TSL2561_ERR("Failed to read @0x%02X\n", reg);
+        TSL2561_LOG(ERROR, "Failed to read @0x%02X\n", reg);
     }
 
 err:
@@ -201,7 +204,7 @@ tsl2561_read16(struct sensor_itf *itf, uint8_t reg, uint16_t *value)
     rc = hal_i2c_master_write(itf->si_num, &data_struct,
                               OS_TICKS_PER_SEC / 10, 1);
     if (rc) {
-        TSL2561_ERR("Failed to address sensor\n");
+        TSL2561_LOG(ERROR, "Failed to address sensor\n");
         goto err;
     }
 
@@ -212,7 +215,7 @@ tsl2561_read16(struct sensor_itf *itf, uint8_t reg, uint16_t *value)
                              OS_TICKS_PER_SEC / 10, 1);
     *value = (uint16_t)payload[0] | ((uint16_t)payload[1] << 8);
     if (rc) {
-        TSL2561_ERR("Failed to read @0x%02X\n", reg);
+        TSL2561_LOG(ERROR, "Failed to read @0x%02X\n", reg);
         goto err;
     }
 
@@ -347,7 +350,7 @@ tsl2561_set_gain(struct sensor_itf *itf, uint8_t gain)
     uint8_t int_time;
 
     if ((gain != TSL2561_LIGHT_GAIN_1X) && (gain != TSL2561_LIGHT_GAIN_16X)) {
-        TSL2561_ERR("Invalid gain value\n");
+        TSL2561_LOG(ERROR, "Invalid gain value\n");
         rc = SYS_EINVAL;
         goto err;
     }
@@ -508,7 +511,8 @@ tsl2561_enable_interrupt(struct sensor_itf *itf, uint8_t enable)
     uint8_t persist_val;
 
     if (enable > 1) {
-        TSL2561_ERR("Invalid value 0x%02X in tsl2561_enable_interrupt\n",
+        TSL2561_LOG(ERROR,
+                    "Invalid value 0x%02X in tsl2561_enable_interrupt\n",
                     enable);
         rc = SYS_EINVAL;
         goto err;
@@ -589,8 +593,6 @@ tsl2561_init(struct os_dev *dev, void *arg)
 
     tsl2561->cfg.mask = SENSOR_TYPE_ALL;
 
-    log_register(dev->od_name, &_log, &log_console_handler, NULL, LOG_SYSLEVEL);
-
     sensor = &tsl2561->sensor;
 
     /* Initialise the stats entry */
diff --git a/hw/drivers/sensors/tsl2561/syscfg.yml b/hw/drivers/sensors/tsl2561/syscfg.yml
index 3a542702da..3c3fff99a0 100644
--- a/hw/drivers/sensors/tsl2561/syscfg.yml
+++ b/hw/drivers/sensors/tsl2561/syscfg.yml
@@ -36,3 +36,6 @@ syscfg.defs:
     TSL2561_ITF_LOCK_TMO:
         description: 'TSL2561 interface lock timeout in milliseconds'
         value: 1000
+    TSL2561_LOG_MODULE:
+        description: 'Numeric module ID to use for TSL2561 log messages'
+        value: 107
diff --git a/net/oic/include/oic/messaging/coap/coap.h b/net/oic/include/oic/messaging/coap/coap.h
index c3eda91e92..bb389e233d 100644
--- a/net/oic/include/oic/messaging/coap/coap.h
+++ b/net/oic/include/oic/messaging/coap/coap.h
@@ -246,7 +246,7 @@ extern STATS_SECT_DECL(coap_stats) coap_stats;
 /* option format serialization (TX) */
 #define COAP_SERIALIZE_INT_OPT(pkt, m, number, field, text)             \
     if (IS_OPTION(pkt, number)) {                                       \
-        OC_LOG_DEBUG(" %s [%u]\n", text, (unsigned int)pkt->field);     \
+        OC_LOG(DEBUG, " %s [%u]\n", text, (unsigned int)pkt->field);    \
         if (coap_append_int_opt(m, number, current_number, pkt->field)) { \
             goto err_mem;                                               \
         }                                                               \
@@ -254,7 +254,7 @@ extern STATS_SECT_DECL(coap_stats) coap_stats;
     }
 #define COAP_SERIALIZE_BYTE_OPT(pkt, m, number, field, text)            \
     if (IS_OPTION(pkt, number)) {                                       \
-        OC_LOG_DEBUG(" %s %u ", text, pkt->field##_len);                \
+        OC_LOG(DEBUG, " %s %u ", text, pkt->field##_len);               \
         OC_LOG_HEX(LOG_LEVEL_DEBUG, pkt->field, pkt->field##_len);      \
         if (coap_append_array_opt(m, number, current_number, pkt->field, \
                                   pkt->field##_len, '\0')) {            \
@@ -264,7 +264,7 @@ extern STATS_SECT_DECL(coap_stats) coap_stats;
     }
 #define COAP_SERIALIZE_STRING_OPT(pkt, m, number, field, splitter, text) \
     if (IS_OPTION(pkt, number)) {                                       \
-        OC_LOG_DEBUG(" %s", text);                                      \
+        OC_LOG(DEBUG, " %s", text);                                     \
         OC_LOG_STR(LOG_LEVEL_DEBUG, pkt->field, pkt->field##_len);      \
         if (coap_append_array_opt(m, number, current_number,            \
                                   (uint8_t *)pkt->field,                \
@@ -275,7 +275,7 @@ extern STATS_SECT_DECL(coap_stats) coap_stats;
     }
 #define COAP_SERIALIZE_BLOCK_OPT(pkt, m, number, field, text)           \
     if (IS_OPTION(pkt, number)) {                                       \
-        OC_LOG_DEBUG(" %s [%lu%s (%u B/blk)]\n", text,                  \
+        OC_LOG(DEBUG, " %s [%lu%s (%u B/blk)]\n", text,                 \
                      (unsigned long)pkt->field##_num,                   \
                      pkt->field##_more ? "+" : "", pkt->field##_size);  \
         uint32_t block = pkt->field##_num << 4;                         \
@@ -283,7 +283,7 @@ extern STATS_SECT_DECL(coap_stats) coap_stats;
             block |= 0x8;                                               \
         }                                                               \
         block |= 0xF & coap_log_2(pkt->field##_size / 16);              \
-        OC_LOG_DEBUG(" %s encoded: 0x%lX\n", text,                      \
+        OC_LOG(DEBUG, " %s encoded: 0x%lX\n", text,                     \
                      (unsigned long)block);                             \
         if (coap_append_int_opt(m, number, current_number, block)) {    \
             goto err_mem;                                               \
diff --git a/net/oic/include/oic/oc_log.h b/net/oic/include/oic/oc_log.h
index 791a3aa27e..94b8218381 100644
--- a/net/oic/include/oic/oc_log.h
+++ b/net/oic/include/oic/oc_log.h
@@ -18,28 +18,25 @@
 #define OC_LOG_H
 
 #include <stdio.h>
-#include <log/log.h>
+#include <modlog/modlog.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-extern struct log oc_log;
-
 /*
- * XXXX, this should not be needed.
+ * XXX, this should not be needed.
  * Figure out why logging takes so much space even with LOG_LEVEL set to 4
  */
 #if MYNEWT_VAL(OC_LOGGING)
-#define OC_LOG_DEBUG(...) LOG_DEBUG(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
-#define OC_LOG_INFO(...) LOG_INFO(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
-#define OC_LOG_ERROR(...) LOG_ERROR(&oc_log, LOG_MODULE_IOTIVITY,__VA_ARGS__)
+
+#define OC_LOG(lvl_, ...) MODLOG_ ## lvl_(LOG_MODULE_IOTIVITY, __VA_ARGS__)
 
 struct oc_endpoint;
-void oc_log_endpoint(uint16_t lvl, struct oc_endpoint *);
-void oc_log_bytes(uint16_t lvl, void *addr, int len, int print_char);
+void oc_log_endpoint(uint8_t lvl, struct oc_endpoint *);
+void oc_log_bytes(uint8_t lvl, void *addr, int len, int print_char);
 struct os_mbuf;
-void oc_log_bytes_mbuf(uint16_t lvl, struct os_mbuf *, int off, int len,
+void oc_log_bytes_mbuf(uint8_t lvl, struct os_mbuf *, int off, int len,
                        int print_char);
 
 #define OC_LOG_ENDPOINT(lvl, ep)                                        \
@@ -79,9 +76,7 @@ void oc_log_bytes_mbuf(uint16_t lvl, struct os_mbuf *, int off, int len,
 
 #else
 
-#define OC_LOG_DEBUG(...)
-#define OC_LOG_INFO(...)
-#define OC_LOG_ERROR(...)
+#define OC_LOG(lvl_, ...)
 #define OC_LOG_ENDPOINT(...)
 #define OC_LOG_STR(...)
 #define OC_LOG_STR_MBUF(...)
diff --git a/net/oic/include/oic/port/mynewt/config.h b/net/oic/include/oic/port/mynewt/config.h
index ee054b3a6a..a547a14329 100644
--- a/net/oic/include/oic/port/mynewt/config.h
+++ b/net/oic/include/oic/port/mynewt/config.h
@@ -26,8 +26,6 @@ extern "C" {
 #define DEBUG 1
 #endif
 
-extern struct log oc_log;
-
 typedef os_time_t oc_clock_time_t;
 #define OC_CLOCK_CONF_TICKS_PER_SECOND (OS_TICKS_PER_SEC)
 #ifdef ARCH_sim
diff --git a/net/oic/pkg.yml b/net/oic/pkg.yml
index 2e9400698f..cc1e752d0c 100644
--- a/net/oic/pkg.yml
+++ b/net/oic/pkg.yml
@@ -27,8 +27,9 @@ pkg.deps:
     - encoding/cborattr
     - encoding/tinycbor
     - kernel/os
+    - sys/log/modlog
+
 pkg.req_apis:
-    - log
     - stats
 
 pkg.deps.OC_TRANSPORT_GATT:
diff --git a/net/oic/src/api/oc_buffer.c b/net/oic/src/api/oc_buffer.c
index 9d885c4e1f..dfd255f45e 100644
--- a/net/oic/src/api/oc_buffer.c
+++ b/net/oic/src/api/oc_buffer.c
@@ -75,7 +75,7 @@ oc_buffer_tx(struct os_event *ev)
 
     while ((m = os_mqueue_get(&oc_outq)) != NULL) {
         STAILQ_NEXT(OS_MBUF_PKTHDR(m), omp_next) = NULL;
-        OC_LOG_DEBUG("oc_buffer_tx: ");
+        OC_LOG(DEBUG, "oc_buffer_tx: ");
         OC_LOG_ENDPOINT(LOG_LEVEL_DEBUG, OC_MBUF_ENDPOINT(m));
 #ifdef OC_CLIENT
         if (OC_MBUF_ENDPOINT(m)->ep.oe_flags & OC_ENDPOINT_MULTICAST) {
@@ -85,7 +85,7 @@ oc_buffer_tx(struct os_event *ev)
 #ifdef OC_SECURITY
             /* XXX convert this */
             if (OC_MBUF_ENDPOINT(m)->flags & SECURED) {
-                OC_LOG_DEBUG("oc_buffer_tx: DTLS\n");
+                OC_LOG(DEBUG, "oc_buffer_tx: DTLS\n");
 
                 if (!oc_sec_dtls_connected(oe)) {
                     oc_process_post(&oc_dtls_handler,
@@ -114,7 +114,7 @@ oc_buffer_rx(struct os_event *ev)
 #endif
 
     while ((m = os_mqueue_get(&oc_inq)) != NULL) {
-        OC_LOG_DEBUG("oc_buffer_rx: ");
+        OC_LOG(DEBUG, "oc_buffer_rx: ");
         OC_LOG_ENDPOINT(LOG_LEVEL_DEBUG, OC_MBUF_ENDPOINT(m));
 
 #ifdef OC_SECURITY
@@ -123,7 +123,7 @@ oc_buffer_rx(struct os_event *ev)
          */
         b = m->om_data[0];
         if (b > 19 && b < 64) {
-            OC_LOG_DEBUG("oc_buffer_rx: encrypted request\n");
+            OC_LOG(DEBUG, "oc_buffer_rx: encrypted request\n");
             oc_process_post(&oc_dtls_handler, oc_events[UDP_TO_DTLS_EVENT], m);
         } else {
             coap_receive(m);
diff --git a/net/oic/src/api/oc_main.c b/net/oic/src/api/oc_main.c
index 23d4920874..ea3917d0e6 100644
--- a/net/oic/src/api/oc_main.c
+++ b/net/oic/src/api/oc_main.c
@@ -78,7 +78,7 @@ oc_main_init(oc_handler_t *handler)
         goto err;
     }
 
-    OC_LOG_INFO("oic: Initialized\n");
+    OC_LOG(INFO, "oic: Initialized\n");
 
 #ifdef OC_CLIENT
     if (handler->requests_entry) {
@@ -104,7 +104,7 @@ void
 oc_main_shutdown(void)
 {
     if (initialized == false) {
-        OC_LOG_ERROR("oic: not initialized\n");
+        OC_LOG(ERROR, "oic: not initialized\n");
         return;
     }
 
diff --git a/net/oic/src/api/oc_rep.c b/net/oic/src/api/oc_rep.c
index 04e87f88c4..1113220319 100644
--- a/net/oic/src/api/oc_rep.c
+++ b/net/oic/src/api/oc_rep.c
@@ -23,7 +23,6 @@
 
 #include "oic/port/mynewt/config.h"
 #include "oic/oc_rep.h"
-#include "oic/oc_log.h"
 #include "oic/port/mynewt/config.h"
 #include "port/oc_assert.h"
 #include "api/oc_priv.h"
diff --git a/net/oic/src/api/oc_ri.c b/net/oic/src/api/oc_ri.c
index d88f9e021e..8e888a9027 100644
--- a/net/oic/src/api/oc_ri.c
+++ b/net/oic/src/api/oc_ri.c
@@ -552,22 +552,22 @@ oc_ri_invoke_coap_entity_handler(struct coap_packet_rx *request,
 
   if (bad_request) {
     if (!m) {
-        OC_LOG_ERROR("ocri: No bufs\n");
+        OC_LOG(ERROR, "ocri: No bufs\n");
         response_buffer.code = oc_status_code(OC_STATUS_SERVICE_UNAVAILABLE);
     } else {
-        OC_LOG_ERROR("ocri: Bad request\n");
+        OC_LOG(ERROR, "ocri: Bad request\n");
         /* Return a 4.00 response */
         response_buffer.code = oc_status_code(OC_STATUS_BAD_REQUEST);
     }
     success = false;
   } else if (!cur_resource) {
-    OC_LOG_ERROR("ocri: Could not find resource\n");
+    OC_LOG(ERROR, "ocri: Could not find resource\n");
     /* Return a 4.04 response if the requested resource was not found */
     response_buffer.response_length = 0;
     response_buffer.code = oc_status_code(OC_STATUS_NOT_FOUND);
     success = false;
   } else if (!method_impl) {
-    OC_LOG_ERROR("ocri: Could not find method\n");
+    OC_LOG(ERROR, "ocri: Could not find method\n");
     /* Return a 4.05 response if the resource does not implement the
      * request method.
      */
@@ -576,7 +576,7 @@ oc_ri_invoke_coap_entity_handler(struct coap_packet_rx *request,
     success = false;
   }
   else if (!authorized) {
-    OC_LOG_ERROR("ocri: Subject not authorized\n");
+    OC_LOG(ERROR, "ocri: Subject not authorized\n");
     /* If the requestor (subject) does not have access granted via an
      * access control entry in the ACL, then it is not authorized to
      * access the resource. A 4.03 response is sent.
diff --git a/net/oic/src/messaging/coap/coap.c b/net/oic/src/messaging/coap/coap.c
index 4b185f936d..238f42e161 100644
--- a/net/oic/src/messaging/coap/coap.c
+++ b/net/oic/src/messaging/coap/coap.c
@@ -159,7 +159,7 @@ coap_append_int_opt(struct os_mbuf *m, unsigned int number,
     if (0xFFFFFFFF & value) {
         ++i;
     }
-    OC_LOG_DEBUG("OPTION %u (delta %u, len %zu)\n",
+    OC_LOG(DEBUG, "OPTION %u (delta %u, len %zu)\n",
                  number, number - current_number, i);
 
     rc = coap_append_opt_hdr(m, number - current_number, i);
@@ -194,7 +194,7 @@ coap_append_array_opt(struct os_mbuf *m,
     uint8_t *part_end = NULL;
     size_t blk;
 
-    OC_LOG_DEBUG("ARRAY type %u, len %zu\n", number, length);
+    OC_LOG(DEBUG, "ARRAY type %u, len %zu\n", number, length);
 
     if (split_char != '\0') {
         for (j = 0; j <= length + 1; ++j) {
@@ -211,7 +211,7 @@ coap_append_array_opt(struct os_mbuf *m,
                     return rc;
                 }
 
-                OC_LOG_DEBUG("OPTION type %u, delta %u, len %zu\n", number,
+                OC_LOG(DEBUG, "OPTION type %u, delta %u, len %zu\n", number,
                     number - current_number, (int)blk);
 
                 ++j; /* skip the splitter */
@@ -229,7 +229,7 @@ coap_append_array_opt(struct os_mbuf *m,
             return rc;
         }
 
-        OC_LOG_DEBUG("OPTION type %u, delta %u, len %zu\n", number,
+        OC_LOG(DEBUG, "OPTION type %u, delta %u, len %zu\n", number,
             number - current_number, length);
     }
 
@@ -353,7 +353,7 @@ coap_serialize_message(coap_packet_t *pkt, struct os_mbuf *m)
     /* Initialize */
     pkt->version = 1;
 
-    OC_LOG_DEBUG("coap_tx: 0x%x\n", (unsigned)m);
+    OC_LOG(DEBUG, "coap_tx: 0x%x\n", (unsigned)m);
 
     tcp_hdr = oc_endpoint_use_tcp(OC_MBUF_ENDPOINT(m));
 
@@ -480,7 +480,7 @@ coap_serialize_message(coap_packet_t *pkt, struct os_mbuf *m)
         }
         os_mbuf_concat(m, pkt->payload_m);
     }
-    OC_LOG_DEBUG("coap_tx: serialized %u B (header len %u, payload len %u)\n",
+    OC_LOG(DEBUG, "coap_tx: serialized %u B (header len %u, payload len %u)\n",
         OS_MBUF_PKTLEN(m), OS_MBUF_PKTLEN(m) - pkt->payload_len,
         pkt->payload_len);
 
@@ -496,7 +496,7 @@ coap_serialize_message(coap_packet_t *pkt, struct os_mbuf *m)
 void
 coap_send_message(struct os_mbuf *m, int dup)
 {
-    OC_LOG_INFO("coap_send_message(): (%u) %s\n", OS_MBUF_PKTLEN(m),
+    OC_LOG(INFO, "coap_send_message(): (%u) %s\n", OS_MBUF_PKTLEN(m),
       dup ? "dup" : "");
 
     STATS_INC(coap_stats, oframe);
@@ -668,7 +668,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
     }
     cur_opt += pkt->token_len;
 
-    OC_LOG_DEBUG("Token (len %u) ", pkt->token_len);
+    OC_LOG(DEBUG, "Token (len %u) ", pkt->token_len);
     OC_LOG_HEX(LOG_LEVEL_DEBUG, pkt->token, pkt->token_len);
 
     /* parse options */
@@ -726,7 +726,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
         opt_num += opt_delta;
 
         if (opt_num < COAP_OPTION_SIZE1) {
-            OC_LOG_DEBUG("OPTION %u (delta %u, len %zu): ",
+            OC_LOG(DEBUG, "OPTION %u (delta %u, len %zu): ",
                          opt_num, opt_delta, opt_len);
             SET_OPTION(pkt, opt_num);
         }
@@ -734,11 +734,11 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
         switch (opt_num) {
         case COAP_OPTION_CONTENT_FORMAT:
             pkt->content_format = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Content-Format [%u]\n", pkt->content_format);
+            OC_LOG(DEBUG, "Content-Format [%u]\n", pkt->content_format);
             break;
         case COAP_OPTION_MAX_AGE:
             pkt->max_age = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Max-Age [%lu]\n", (unsigned long)pkt->max_age);
+            OC_LOG(DEBUG, "Max-Age [%lu]\n", (unsigned long)pkt->max_age);
             break;
 #if 0
         case COAP_OPTION_ETAG:
@@ -746,13 +746,13 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             if (os_mbuf_copydata(m, cur_opt, pkt->etag_len, pkt->etag)) {
                 goto err_short;
             }
-            OC_LOG_DEBUG("ETag %u ");
+            OC_LOG(DEBUG, "ETag %u ");
             OC_LOG_HEX(LOG_LEVEL_DEBUG, pkt->etag, pkt->etag_len);
             break;
 #endif
         case COAP_OPTION_ACCEPT:
             pkt->accept = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Accept [%u]\n", pkt->accept);
+            OC_LOG(DEBUG, "Accept [%u]\n", pkt->accept);
             break;
 #if 0
         case COAP_OPTION_IF_MATCH:
@@ -762,12 +762,12 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
                                  pkt->if_match)) {
                 goto err_short;
             }
-            OC_LOG_DEBUG("If-Match %u ");
+            OC_LOG(DEBUG, "If-Match %u ");
             OC_LOG_HEX(LOG_LEVEL_DEBUG, pkt->if_match, pkt->if_match_len);
             break;
         case COAP_OPTION_IF_NONE_MATCH:
             pkt->if_none_match = 1;
-            OC_LOG_DEBUG("If-None-Match\n");
+            OC_LOG(DEBUG, "If-None-Match\n");
             break;
 
         case COAP_OPTION_PROXY_URI:
@@ -775,7 +775,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             pkt->proxy_uri_off = cur_opt;
             pkt->proxy_uri_len = opt_len;
 #endif
-            OC_LOG_DEBUG("Proxy-Uri NOT IMPLEMENTED\n");
+            OC_LOG(DEBUG, "Proxy-Uri NOT IMPLEMENTED\n");
             coap_error_message =
               "This is a constrained server (MyNewt)";
             STATS_INC(coap_stats, ierr);
@@ -786,7 +786,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             pkt->proxy_scheme_off = cur_opt;
             pkt->proxy_scheme_len = opt_len;
 #endif
-            OC_LOG_DEBUG("Proxy-Scheme NOT IMPLEMENTED\n");
+            OC_LOG(DEBUG, "Proxy-Scheme NOT IMPLEMENTED\n");
             coap_error_message =
               "This is a constrained server (MyNewt)";
             STATS_INC(coap_stats, ierr);
@@ -796,20 +796,20 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
         case COAP_OPTION_URI_HOST:
             pkt->uri_host_off = cur_opt;
             pkt->uri_host_len = opt_len;
-            OC_LOG_DEBUG("Uri-Host ");
+            OC_LOG(DEBUG, "Uri-Host ");
             OC_LOG_STR_MBUF(LOG_LEVEL_DEBUG, m, pkt->uri_host_off,
                             pkt->uri_host_len);
             break;
         case COAP_OPTION_URI_PORT:
             pkt->uri_port = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Uri-Port [%u]\n", pkt->uri_port);
+            OC_LOG(DEBUG, "Uri-Port [%u]\n", pkt->uri_port);
             break;
 #endif
         case COAP_OPTION_URI_PATH:
             /* coap_merge_multi_option() operates in-place on the buf */
             coap_merge_multi_option(m, &pkt->uri_path_off, &pkt->uri_path_len,
                                     cur_opt, opt_len, '/');
-            OC_LOG_DEBUG("Uri-Path ");
+            OC_LOG(DEBUG, "Uri-Path ");
             OC_LOG_STR_MBUF(LOG_LEVEL_DEBUG, m, pkt->uri_path_off,
                             pkt->uri_path_len);
             break;
@@ -817,7 +817,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             /* coap_merge_multi_option() operates in-place on the mbuf */
             coap_merge_multi_option(m, &pkt->uri_query_off, &pkt->uri_query_len,
                                     cur_opt, opt_len, '&');
-            OC_LOG_DEBUG("Uri-Query ");
+            OC_LOG(DEBUG, "Uri-Query ");
             OC_LOG_STR_MBUF(LOG_LEVEL_DEBUG, m, pkt->uri_query_off,
                             pkt->uri_query_len);
             break;
@@ -826,7 +826,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             /* coap_merge_multi_option() operates in-place on the mbuf */
             coap_merge_multi_option(m, &pkt->loc_path_off, &pkt->loc_path_len,
                                     cur_opt, opt_len, '/');
-            OC_LOG_DEBUG("Location-Path ");
+            OC_LOG(DEBUG, "Location-Path ");
             OC_LOG_STR_MBUF(LOG_LEVEL_DEBUG, m, pkt->loc_path,
                             pkt->loc_path_len);
             break;
@@ -834,14 +834,14 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             /* coap_merge_multi_option() operates in-place on the mbuf */
             coap_merge_multi_option(m, &pkt->loc_query_off, &pkt->loc_query_len,
                                     cur_opt, opt_len, '&');
-            OC_LOG_DEBUG("Location-Query ");
+            OC_LOG(DEBUG, "Location-Query ");
             OC_LOG_STR_MBUF(LOG_LEVEL_DEBUG, m, pkt->loc_query_off,
                             pkt->loc_query_len);
             break;
 #endif
         case COAP_OPTION_OBSERVE:
             pkt->observe = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Observe [%lu]\n", (unsigned long)pkt->observe);
+            OC_LOG(DEBUG, "Observe [%lu]\n", (unsigned long)pkt->observe);
             break;
         case COAP_OPTION_BLOCK2:
             pkt->block2_num = coap_parse_int_option(m, cur_opt, opt_len);
@@ -850,7 +850,7 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             pkt->block2_offset =
               (pkt->block2_num & ~0x0000000F) << (pkt->block2_num & 0x07);
             pkt->block2_num >>= 4;
-            OC_LOG_DEBUG("Block2 [%lu%s (%u B/blk)]\n",
+            OC_LOG(DEBUG, "Block2 [%lu%s (%u B/blk)]\n",
                          (unsigned long)pkt->block2_num,
                          pkt->block2_more ? "+" : "", pkt->block2_size);
             break;
@@ -861,20 +861,20 @@ coap_parse_message(struct coap_packet_rx *pkt, struct os_mbuf **mp)
             pkt->block1_offset =
               (pkt->block1_num & ~0x0000000F) << (pkt->block1_num & 0x07);
             pkt->block1_num >>= 4;
-            OC_LOG_DEBUG("Block1 [%lu%s (%u B/blk)]\n",
+            OC_LOG(DEBUG, "Block1 [%lu%s (%u B/blk)]\n",
                          (unsigned long)pkt->block1_num,
                          pkt->block1_more ? "+" : "", pkt->block1_size);
             break;
         case COAP_OPTION_SIZE2:
             pkt->size2 = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Size2 [%lu]\n", (unsigned long)pkt->size2);
+            OC_LOG(DEBUG, "Size2 [%lu]\n", (unsigned long)pkt->size2);
             break;
         case COAP_OPTION_SIZE1:
             pkt->size1 = coap_parse_int_option(m, cur_opt, opt_len);
-            OC_LOG_DEBUG("Size1 [%lu]\n", (unsigned long)pkt->size1);
+            OC_LOG(DEBUG, "Size1 [%lu]\n", (unsigned long)pkt->size1);
             break;
         default:
-            OC_LOG_DEBUG("unknown (%u)\n", opt_num);
+            OC_LOG(DEBUG, "unknown (%u)\n", opt_num);
             /* check if critical (odd) */
             if (opt_num & 1) {
                 coap_error_message = "Unsupported critical option";
diff --git a/net/oic/src/messaging/coap/engine.c b/net/oic/src/messaging/coap/engine.c
index 7c0442a583..e45c7dcfe5 100644
--- a/net/oic/src/messaging/coap/engine.c
+++ b/net/oic/src/messaging/coap/engine.c
@@ -64,7 +64,7 @@ coap_receive(struct os_mbuf **mp)
 
     erbium_status_code = NO_ERROR;
 
-    OC_LOG_INFO("CoAP: received datalen=%u\n", OS_MBUF_PKTLEN(*mp));
+    OC_LOG(INFO, "CoAP: received datalen=%u\n", OS_MBUF_PKTLEN(*mp));
 
     memcpy(&endpoint, OC_MBUF_ENDPOINT(*mp),
            oc_endpoint_size(OC_MBUF_ENDPOINT(*mp)));
@@ -75,21 +75,21 @@ coap_receive(struct os_mbuf **mp)
 
     m = *mp;
 /*TODO duplicates suppression, if required by application */
-    OC_LOG_DEBUG("  Parsed: CoAP version: %u, token: 0x%02X%02X, mid: %u\n",
+    OC_LOG(DEBUG, "  Parsed: CoAP version: %u, token: 0x%02X%02X, mid: %u\n",
                  message->version, message->token[0], message->token[1],
                  message->mid);
     switch (message->type) {
     case COAP_TYPE_CON:
-        OC_LOG_DEBUG("  type: CON\n");
+        OC_LOG(DEBUG, "  type: CON\n");
         break;
     case COAP_TYPE_NON:
-        OC_LOG_DEBUG("  type: NON\n");
+        OC_LOG(DEBUG, "  type: NON\n");
         break;
     case COAP_TYPE_ACK:
-        OC_LOG_DEBUG("  type: ACK\n");
+        OC_LOG(DEBUG, "  type: ACK\n");
         break;
     case COAP_TYPE_RST:
-        OC_LOG_DEBUG("  type: RST\n");
+        OC_LOG(DEBUG, "  type: RST\n");
         break;
     default:
         break;
@@ -99,20 +99,20 @@ coap_receive(struct os_mbuf **mp)
         /* handle requests */
         switch (message->code) {
         case COAP_GET:
-            OC_LOG_DEBUG("  method: GET\n");
+            OC_LOG(DEBUG, "  method: GET\n");
             break;
         case COAP_PUT:
-            OC_LOG_DEBUG("  method: PUT\n");
+            OC_LOG(DEBUG, "  method: PUT\n");
             break;
         case COAP_POST:
-            OC_LOG_DEBUG("  method: POST\n");
+            OC_LOG(DEBUG, "  method: POST\n");
             break;
         case COAP_DELETE:
-            OC_LOG_DEBUG("  method: DELETE\n");
+            OC_LOG(DEBUG, "  method: DELETE\n");
             break;
         }
 
-        OC_LOG_DEBUG("  Payload: %d bytes\n", message->payload_len);
+        OC_LOG(DEBUG, "  Payload: %d bytes\n", message->payload_len);
 
         /* use transaction buffer for response to confirmable request */
         transaction = coap_new_transaction(message->mid, OC_MBUF_ENDPOINT(m));
@@ -144,7 +144,7 @@ coap_receive(struct os_mbuf **mp)
         }
         if (coap_get_header_block2(message, &block_num, NULL,
                                    &block_size, &block_offset)) {
-            OC_LOG_DEBUG(" Blockwise: block request %u (%u/%u) @ %u bytes\n",
+            OC_LOG(DEBUG, " Blockwise: block request %u (%u/%u) @ %u bytes\n",
                          (unsigned int) block_num, block_size,
                          COAP_MAX_BLOCK_SIZE, (unsigned int) block_offset);
             block_size = MIN(block_size, COAP_MAX_BLOCK_SIZE);
@@ -163,7 +163,7 @@ coap_receive(struct os_mbuf **mp)
                 if (IS_OPTION(message, COAP_OPTION_BLOCK1) &&
                   response->code < BAD_REQUEST_4_00 &&
                   !IS_OPTION(response, COAP_OPTION_BLOCK1)) {
-                    OC_LOG_ERROR(" Block1 option NOT IMPLEMENTED\n");
+                    OC_LOG(ERROR, " Block1 option NOT IMPLEMENTED\n");
 
                     erbium_status_code = NOT_IMPLEMENTED_5_01;
                     coap_error_message = "NoBlock1Support";
@@ -176,7 +176,7 @@ coap_receive(struct os_mbuf **mp)
                      * unaware of blockwise transfer
                      */
                     if (new_offset == block_offset) {
-                        OC_LOG_DEBUG(" Block: unaware resource %u/%u\n",
+                        OC_LOG(DEBUG, " Block: unaware resource %u/%u\n",
                                      response->payload_len, block_size);
                         if (block_offset >= response->payload_len) {
                             response->code = BAD_OPTION_4_02;
@@ -199,7 +199,7 @@ coap_receive(struct os_mbuf **mp)
 
                         /* resource provides chunk-wise data */
                     } else {
-                        OC_LOG_DEBUG(" Block: aware resource, off %d\n",
+                        OC_LOG(DEBUG, " Block: aware resource, off %d\n",
                                      (int) new_offset);
                         coap_set_header_block2(response, block_num,
                                                new_offset != -1 ||
@@ -213,7 +213,7 @@ coap_receive(struct os_mbuf **mp)
 
                     /* Resource requested Block2 transfer */
                 } else if (new_offset != 0) {
-                    OC_LOG_DEBUG(" block: no block option, using block sz %u\n",
+                    OC_LOG(DEBUG, " block: no block option, using block sz %u\n",
                                  COAP_MAX_BLOCK_SIZE);
 
                     coap_set_header_block2(response, 0, new_offset != -1,
@@ -268,7 +268,7 @@ coap_receive(struct os_mbuf **mp)
             coap_send_transaction(transaction);
         }
     } else if (erbium_status_code == CLEAR_TRANSACTION) {
-        OC_LOG_DEBUG(" Clearing transaction for manual response\n");
+        OC_LOG(DEBUG, " Clearing transaction for manual response\n");
         /* used in server for separate response */
         coap_clear_transaction(transaction);
     }
diff --git a/net/oic/src/messaging/coap/observe.c b/net/oic/src/messaging/coap/observe.c
index b22daa3218..c24bedb550 100644
--- a/net/oic/src/messaging/coap/observe.c
+++ b/net/oic/src/messaging/coap/observe.c
@@ -81,7 +81,7 @@ add_observer(oc_resource_t *resource, oc_endpoint_t *endpoint,
         o->obs_counter = observe_counter;
         o->resource = resource;
         resource->num_observers++;
-        OC_LOG_DEBUG("Adding observer (%u/%u) for /%s [0x%02X%02X]\n",
+        OC_LOG(DEBUG, "Adding observer (%u/%u) for /%s [0x%02X%02X]\n",
           coap_observer_pool.mp_num_blocks - coap_observer_pool.mp_num_free,
           coap_observer_pool.mp_num_blocks, o->url, o->token[0], o->token[1]);
         SLIST_INSERT_HEAD(&oc_observers, o, next);
@@ -95,7 +95,7 @@ add_observer(oc_resource_t *resource, oc_endpoint_t *endpoint,
 void
 coap_remove_observer(coap_observer_t *o)
 {
-    OC_LOG_DEBUG("Removing observer for /%s [0x%02X%02X]\n",
+    OC_LOG(DEBUG, "Removing observer for /%s [0x%02X%02X]\n",
                  o->url, o->token[0], o->token[1]);
     SLIST_REMOVE(&oc_observers, o, coap_observer, next);
     os_memblock_put(&coap_observer_pool, o);
@@ -200,14 +200,14 @@ coap_notify_observers(oc_resource_t *resource,
 
     if (resource) {
         if (!resource->num_observers) {
-            OC_LOG_DEBUG("coap_notify_observers: no observers left\n");
+            OC_LOG(DEBUG, "coap_notify_observers: no observers left\n");
             return 0;
         }
         num_observers = resource->num_observers;
     }
     response.separate_response = 0;
     if (!response_buf && resource) {
-        OC_LOG_DEBUG("coap_notify_observers: Issue GET request to resource\n");
+        OC_LOG(DEBUG, "coap_notify_observers: Issue GET request to resource\n");
         /* performing GET on the resource */
         m = os_msys_get_pkthdr(0, 0);
         if (!m) {
@@ -223,7 +223,7 @@ coap_notify_observers(oc_resource_t *resource,
         resource->get_handler(&request, resource->default_interface);
         response_buf = &response_buffer;
         if (response_buf->code == OC_IGNORE) {
-            OC_LOG_ERROR("coap_notify_observers: Resource ignored request\n");
+            OC_LOG(ERROR, "coap_notify_observers: Resource ignored request\n");
             os_mbuf_free_chain(m);
             return num_observers;
         }
@@ -255,14 +255,14 @@ coap_notify_observers(oc_resource_t *resource,
             req->mid = 0;
             memcpy(req->token, obs->token, obs->token_len);
             req->token_len = obs->token_len;
-            OC_LOG_DEBUG("Resource is SLOW; creating separate response\n");
+            OC_LOG(DEBUG, "Resource is SLOW; creating separate response\n");
             if (coap_separate_accept(req, response.separate_response,
                 &obs->endpoint, 0) == 1) {
                 response.separate_response->active = 1;
             }
         } else {
 #endif /* OC_SEPARATE_RESPONSES */
-            OC_LOG_DEBUG("coap_notify_observers: notifying observer\n");
+            OC_LOG(DEBUG, "coap_notify_observers: notifying observer\n");
             coap_transaction_t *transaction = NULL;
             if (response_buf && (transaction = coap_new_transaction(
                   coap_get_mid(), &obs->endpoint))) {
@@ -279,7 +279,7 @@ coap_notify_observers(oc_resource_t *resource,
                 notification->mid = transaction->mid;
                 if (!oc_endpoint_use_tcp(&obs->endpoint) &&
                     obs->obs_counter % COAP_OBSERVE_REFRESH_INTERVAL == 0) {
-                    OC_LOG_DEBUG("coap_observe_notify: forcing CON "
+                    OC_LOG(DEBUG, "coap_observe_notify: forcing CON "
                                  "notification to check for client liveness\n");
                     notification->type = COAP_TYPE_CON;
                 }
diff --git a/net/oic/src/messaging/coap/separate.c b/net/oic/src/messaging/coap/separate.c
index 797f722c99..3ab7927d77 100644
--- a/net/oic/src/messaging/coap/separate.c
+++ b/net/oic/src/messaging/coap/separate.c
@@ -93,7 +93,7 @@ coap_separate_accept(struct coap_packet_rx *coap_req,
     erbium_status_code = CLEAR_TRANSACTION;
     /* send separate ACK for CON */
     if (coap_req->type == COAP_TYPE_CON) {
-        OC_LOG_DEBUG("Sending ACK for separate response\n");
+        OC_LOG(DEBUG, "Sending ACK for separate response\n");
         coap_packet_t ack[1];
         /* ACK with empty code (0) */
         coap_init_message(ack, COAP_TYPE_ACK, 0, coap_req->mid);
diff --git a/net/oic/src/messaging/coap/transactions.c b/net/oic/src/messaging/coap/transactions.c
index b14e7d75dc..24a998753d 100644
--- a/net/oic/src/messaging/coap/transactions.c
+++ b/net/oic/src/messaging/coap/transactions.c
@@ -100,7 +100,7 @@ coap_send_transaction(coap_transaction_t *t)
 
     confirmable = (COAP_TYPE_CON == t->type) ? true : false;
 
-    OC_LOG_DEBUG("Sending transaction %u\n", t->mid);
+    OC_LOG(DEBUG, "Sending transaction %u\n", t->mid);
 
     if (confirmable) {
         if (t->retrans_counter < COAP_MAX_RETRANSMIT) {
@@ -110,11 +110,11 @@ coap_send_transaction(coap_transaction_t *t)
                   COAP_RESPONSE_TIMEOUT_TICKS +
                   (oc_random_rand() %
                     (oc_clock_time_t)COAP_RESPONSE_TIMEOUT_BACKOFF_MASK);
-                OC_LOG_DEBUG("Initial interval " OC_CLK_FMT "\n",
+                OC_LOG(DEBUG, "Initial interval " OC_CLK_FMT "\n",
                              t->retrans_tmo);
             } else {
                 t->retrans_tmo <<= 1; /* double */
-                OC_LOG_DEBUG("Doubled " OC_CLK_FMT "\n", t->retrans_tmo);
+                OC_LOG(DEBUG, "Doubled " OC_CLK_FMT "\n", t->retrans_tmo);
             }
 
             os_callout_reset(&t->retrans_timer, t->retrans_tmo);
@@ -124,7 +124,7 @@ coap_send_transaction(coap_transaction_t *t)
             t = NULL;
         } else {
             /* timed out */
-            OC_LOG_DEBUG("Timeout\n");
+            OC_LOG(DEBUG, "Timeout\n");
 
 #ifdef OC_SERVER
             /* handle observers */
@@ -191,7 +191,7 @@ coap_transaction_retrans(struct os_event *ev)
 {
     coap_transaction_t *t = ev->ev_arg;
     ++(t->retrans_counter);
-    OC_LOG_DEBUG("Retransmitting %u (%u)\n", t->mid, t->retrans_counter);
+    OC_LOG(DEBUG, "Retransmitting %u (%u)\n", t->mid, t->retrans_counter);
     coap_send_transaction(t);
 }
 
diff --git a/net/oic/src/port/mynewt/adaptor.c b/net/oic/src/port/mynewt/adaptor.c
index f61c19fb9a..2bb5d4b536 100644
--- a/net/oic/src/port/mynewt/adaptor.c
+++ b/net/oic/src/port/mynewt/adaptor.c
@@ -29,7 +29,6 @@
 #include "oic/port/mynewt/transport.h"
 
 static struct os_eventq *oc_evq;
-struct log oc_log;
 const struct oc_transport *oc_transports[OC_TRANSPORT_MAX];
 
 struct os_eventq *
@@ -98,7 +97,7 @@ oc_send_buffer(struct os_mbuf *m)
     if (ot) {
         ot->ot_tx_ucast(m);
     } else {
-        OC_LOG_ERROR("Unknown transport option %u\n", oe->ep.oe_type);
+        OC_LOG(ERROR, "Unknown transport option %u\n", oe->ep.oe_type);
         os_mbuf_free_chain(m);
     }
 }
@@ -151,7 +150,7 @@ oc_get_trans_security(const struct oc_endpoint *oe)
             return 0;
         }
     }
-    OC_LOG_ERROR("Unknown transport option %u\n", oe->ep.oe_type);
+    OC_LOG(ERROR, "Unknown transport option %u\n", oe->ep.oe_type);
     return 0;
 }
 
diff --git a/net/oic/src/port/mynewt/ble_adaptor.c b/net/oic/src/port/mynewt/ble_adaptor.c
index e0eafa3a92..d0cef2d177 100644
--- a/net/oic/src/port/mynewt/ble_adaptor.c
+++ b/net/oic/src/port/mynewt/ble_adaptor.c
@@ -220,7 +220,7 @@ oc_ble_reass(struct os_mbuf *om1, uint16_t conn_handle, uint8_t srv_idx)
     STATS_INC(oc_ble_stats, iseg);
     STATS_INCN(oc_ble_stats, ibytes, pkt1->omp_len);
 
-    OC_LOG_DEBUG("oc_gatt rx seg %u-%x-%u\n", conn_handle,
+    OC_LOG(DEBUG, "oc_gatt rx seg %u-%x-%u\n", conn_handle,
                  (unsigned)pkt1, pkt1->omp_len);
 
     STAILQ_FOREACH(pkt2, &oc_ble_reass_q, omp_next) {
@@ -251,7 +251,7 @@ oc_ble_reass(struct os_mbuf *om1, uint16_t conn_handle, uint8_t srv_idx)
         if (OS_MBUF_USRHDR_LEN(om1) < sizeof(struct oc_endpoint_ble)) {
             om2 = os_msys_get_pkthdr(0, sizeof(struct oc_endpoint_ble));
             if (!om2) {
-                OC_LOG_ERROR("oc_gatt_rx: Could not allocate mbuf\n");
+                OC_LOG(ERROR, "oc_gatt_rx: Could not allocate mbuf\n");
                 STATS_INC(oc_ble_stats, ierr);
                 return -1;
             }
@@ -330,7 +330,7 @@ oc_ble_coap_gatt_srv_init(void)
 void
 oc_ble_coap_conn_new(uint16_t conn_handle)
 {
-    OC_LOG_DEBUG("oc_gatt newconn %x\n", conn_handle);
+    OC_LOG(DEBUG, "oc_gatt newconn %x\n", conn_handle);
 }
 
 void
@@ -340,7 +340,7 @@ oc_ble_coap_conn_del(uint16_t conn_handle)
     struct os_mbuf *m;
     struct oc_endpoint_ble *oe_ble;
 
-    OC_LOG_DEBUG("oc_gatt endconn %x\n", conn_handle);
+    OC_LOG(DEBUG, "oc_gatt endconn %x\n", conn_handle);
     STAILQ_FOREACH(pkt, &oc_ble_reass_q, omp_next) {
         m = OS_MBUF_PKTHDR_TO_MBUF(pkt);
         oe_ble = (struct oc_endpoint_ble *)OC_MBUF_ENDPOINT(m);
@@ -422,7 +422,7 @@ oc_send_buffer_gatt(struct os_mbuf *m)
 #endif
 
 #if (MYNEWT_VAL(OC_CLIENT) == 1)
-    OC_LOG_ERROR("oc_gatt send not supported on client");
+    OC_LOG(ERROR, "oc_gatt send not supported on client");
 #endif
 
 #if (MYNEWT_VAL(OC_SERVER) == 1)
diff --git a/net/oic/src/port/mynewt/ip4_adaptor.c b/net/oic/src/port/mynewt/ip4_adaptor.c
index d949e42cbd..083fb19cf5 100644
--- a/net/oic/src/port/mynewt/ip4_adaptor.c
+++ b/net/oic/src/port/mynewt/ip4_adaptor.c
@@ -163,7 +163,7 @@ oc_send_buffer_ip4_int(struct os_mbuf *m, int is_mcast)
             }
             rc = mn_sendto(oc_ucast4, n, (struct mn_sockaddr *)&to);
             if (rc != 0) {
-                OC_LOG_ERROR("Failed to send buffer %u on %x\n",
+                OC_LOG(ERROR, "Failed to send buffer %u on %x\n",
                              OS_MBUF_PKTHDR(m)->omp_len, if2_idx);
                 STATS_INC(oc_ip4_stats, oerr);
                 os_mbuf_free_chain(n);
@@ -178,7 +178,7 @@ oc_send_buffer_ip4_int(struct os_mbuf *m, int is_mcast)
             } else {
                 rc = mn_sendto(oc_ucast4, m, (struct mn_sockaddr *) &to);
                 if (rc != 0) {
-                    OC_LOG_ERROR("Failed sending buffer %u on itf %x\n",
+                    OC_LOG(ERROR, "Failed sending buffer %u on itf %x\n",
                                  OS_MBUF_PKTHDR(m)->omp_len, if2_idx);
                     STATS_INC(oc_ip4_stats, oerr);
                     os_mbuf_free_chain(m);
@@ -190,7 +190,7 @@ oc_send_buffer_ip4_int(struct os_mbuf *m, int is_mcast)
     } else {
         rc = mn_sendto(oc_ucast4, m, (struct mn_sockaddr *) &to);
         if (rc != 0) {
-            OC_LOG_ERROR("Failed to send buffer %u ucast\n",
+            OC_LOG(ERROR, "Failed to send buffer %u ucast\n",
                          OS_MBUF_PKTHDR(m)->omp_len);
             STATS_INC(oc_ip4_stats, oerr);
             os_mbuf_free_chain(m);
@@ -230,7 +230,7 @@ oc_attempt_rx_ip4_sock(struct mn_socket *rxsock)
     STATS_INCN(oc_ip4_stats, ibytes, OS_MBUF_PKTLEN(n));
     m = os_msys_get_pkthdr(0, sizeof(struct oc_endpoint_ip));
     if (!m) {
-        OC_LOG_ERROR("Could not allocate RX buffer\n");
+        OC_LOG(ERROR, "Could not allocate RX buffer\n");
         goto rx_attempt_err;
     }
     OS_MBUF_PKTHDR(m)->omp_len = OS_MBUF_PKTHDR(n)->omp_len;
@@ -314,7 +314,7 @@ oc_connectivity_init_ip4(void)
 
     rc = mn_socket(&oc_ucast4, MN_PF_INET, MN_SOCK_DGRAM, 0);
     if (rc != 0 || !oc_ucast4) {
-        OC_LOG_ERROR("Could not create oc unicast v4 socket\n");
+        OC_LOG(ERROR, "Could not create oc unicast v4 socket\n");
         return rc;
     }
     mn_socket_set_cbs(oc_ucast4, oc_ucast4, &oc_sock4_cbs);
@@ -323,7 +323,7 @@ oc_connectivity_init_ip4(void)
     rc = mn_socket(&oc_mcast4, MN_PF_INET, MN_SOCK_DGRAM, 0);
     if (rc != 0 || !oc_mcast4) {
         mn_close(oc_ucast4);
-        OC_LOG_ERROR("Could not create oc multicast v4 socket\n");
+        OC_LOG(ERROR, "Could not create oc multicast v4 socket\n");
         return rc;
     }
     mn_socket_set_cbs(oc_mcast4, oc_mcast4, &oc_sock4_cbs);
@@ -336,7 +336,7 @@ oc_connectivity_init_ip4(void)
 
     rc = mn_bind(oc_ucast4, (struct mn_sockaddr *)&sin);
     if (rc != 0) {
-        OC_LOG_ERROR("Could not bind oc unicast v4 socket\n");
+        OC_LOG(ERROR, "Could not bind oc unicast v4 socket\n");
         goto oc_connectivity_init_err;
     }
 
@@ -364,13 +364,13 @@ oc_connectivity_init_ip4(void)
             continue;
         }
 
-        OC_LOG_DEBUG("Joined Coap v4 mcast group on %s\n", itf.mif_name);
+        OC_LOG(DEBUG, "Joined Coap v4 mcast group on %s\n", itf.mif_name);
     }
 
     sin.msin_port = htons(COAP_PORT_UNSECURED);
     rc = mn_bind(oc_mcast4, (struct mn_sockaddr *)&sin);
     if (rc != 0) {
-        OC_LOG_ERROR("Could not bind oc v4 multicast socket\n");
+        OC_LOG(ERROR, "Could not bind oc v4 multicast socket\n");
         goto oc_connectivity_init_err;
     }
 #endif
diff --git a/net/oic/src/port/mynewt/ip_adaptor.c b/net/oic/src/port/mynewt/ip_adaptor.c
index 847ca746d5..8847a09ed5 100644
--- a/net/oic/src/port/mynewt/ip_adaptor.c
+++ b/net/oic/src/port/mynewt/ip_adaptor.c
@@ -165,7 +165,7 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
             to.msin6_scope_id = itf2.mif_idx;
             rc = mn_sendto(oc_ucast6, n, (struct mn_sockaddr *) &to);
             if (rc != 0) {
-                OC_LOG_ERROR("Failed to send buffer %u on itf %d\n",
+                OC_LOG(ERROR, "Failed to send buffer %u on itf %d\n",
                              OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
                 STATS_INC(oc_ip_stats, oerr);
                 os_mbuf_free_chain(n);
@@ -176,7 +176,7 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
             to.msin6_scope_id = itf2.mif_idx;
             rc = mn_sendto(oc_ucast6, m, (struct mn_sockaddr *) &to);
             if (rc != 0) {
-                OC_LOG_ERROR("Failed sending buffer %u on itf %d\n",
+                OC_LOG(ERROR, "Failed sending buffer %u on itf %d\n",
                              OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
                 STATS_INC(oc_ip_stats, oerr);
                 os_mbuf_free_chain(m);
@@ -187,7 +187,7 @@ oc_send_buffer_ip6_int(struct os_mbuf *m, int is_mcast)
     } else {
         rc = mn_sendto(oc_ucast6, m, (struct mn_sockaddr *) &to);
         if (rc != 0) {
-            OC_LOG_ERROR("Failed to send buffer %u on itf %d\n",
+            OC_LOG(ERROR, "Failed to send buffer %u on itf %d\n",
                          OS_MBUF_PKTHDR(m)->omp_len, to.msin6_scope_id);
             STATS_INC(oc_ip_stats, oerr);
             os_mbuf_free_chain(m);
@@ -228,7 +228,7 @@ oc_attempt_rx_ip6_sock(struct mn_socket *rxsock)
     STATS_INCN(oc_ip_stats, ibytes, OS_MBUF_PKTLEN(n));
     m = os_msys_get_pkthdr(0, sizeof(struct oc_endpoint_ip));
     if (!m) {
-        OC_LOG_ERROR("Could not allocate RX buffer\n");
+        OC_LOG(ERROR, "Could not allocate RX buffer\n");
         goto rx_attempt_err;
     }
     OS_MBUF_PKTHDR(m)->omp_len = OS_MBUF_PKTHDR(n)->omp_len;
@@ -314,7 +314,7 @@ oc_connectivity_init_ip6(void)
 
     rc = mn_socket(&oc_ucast6, MN_PF_INET6, MN_SOCK_DGRAM, 0);
     if (rc != 0 || !oc_ucast6) {
-        OC_LOG_ERROR("Could not create oc unicast socket\n");
+        OC_LOG(ERROR, "Could not create oc unicast socket\n");
         return rc;
     }
     mn_socket_set_cbs(oc_ucast6, oc_ucast6, &oc_sock6_cbs);
@@ -323,7 +323,7 @@ oc_connectivity_init_ip6(void)
     rc = mn_socket(&oc_mcast6, MN_PF_INET6, MN_SOCK_DGRAM, 0);
     if (rc != 0 || !oc_mcast6) {
         mn_close(oc_ucast6);
-        OC_LOG_ERROR("Could not create oc multicast socket\n");
+        OC_LOG(ERROR, "Could not create oc multicast socket\n");
         return rc;
     }
     mn_socket_set_cbs(oc_mcast6, oc_mcast6, &oc_sock6_cbs);
@@ -338,7 +338,7 @@ oc_connectivity_init_ip6(void)
 
     rc = mn_bind(oc_ucast6, (struct mn_sockaddr *)&sin);
     if (rc != 0) {
-        OC_LOG_ERROR("Could not bind oc unicast socket\n");
+        OC_LOG(ERROR, "Could not bind oc unicast socket\n");
         goto oc_connectivity_init_err;
     }
 
@@ -366,13 +366,13 @@ oc_connectivity_init_ip6(void)
             continue;
         }
 
-        OC_LOG_DEBUG("Joined Coap mcast group on %s\n", itf.mif_name);
+        OC_LOG(DEBUG, "Joined Coap mcast group on %s\n", itf.mif_name);
     }
 
     sin.msin6_port = htons(COAP_PORT_UNSECURED);
     rc = mn_bind(oc_mcast6, (struct mn_sockaddr *)&sin);
     if (rc != 0) {
-        OC_LOG_ERROR("Could not bind oc multicast socket\n");
+        OC_LOG(ERROR, "Could not bind oc multicast socket\n");
         goto oc_connectivity_init_err;
     }
 #endif
diff --git a/net/oic/src/port/mynewt/log.c b/net/oic/src/port/mynewt/log.c
index a38a44490f..d0ff7f8e20 100644
--- a/net/oic/src/port/mynewt/log.c
+++ b/net/oic/src/port/mynewt/log.c
@@ -19,7 +19,7 @@
 
 #include <string.h>
 
-#include <log/log.h>
+#include <modlog/modlog.h>
 #if (MYNEWT_VAL(OC_TRANSPORT_IP) == 1)
 #include <mn_socket/mn_socket.h>
 #endif
@@ -28,7 +28,7 @@
 #include "oic/port/mynewt/transport.h"
 
 void
-oc_log_endpoint(uint16_t lvl, struct oc_endpoint *oe)
+oc_log_endpoint(uint8_t lvl, struct oc_endpoint *oe)
 {
     char *str;
     char tmp[46 + 6];
@@ -47,36 +47,36 @@ oc_log_endpoint(uint16_t lvl, struct oc_endpoint *oe)
             str = "<unkwn>";
         }
     }
-    log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "%s\n", str);
+    modlog_printf(LOG_MODULE_IOTIVITY, lvl, "%s\n", str);
 }
 
 void
-oc_log_bytes(uint16_t lvl, void *addr, int len, int print_char)
+oc_log_bytes(uint8_t lvl, void *addr, int len, int print_char)
 {
     int i;
     uint8_t *p = (uint8_t *)addr;
 
     (void)p;
-    log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "[");
+    modlog_printf(LOG_MODULE_IOTIVITY, lvl, "[");
     for (i = 0; i < len; i++) {
         if (print_char) {
-            log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "%c", p[i]);
+            modlog_printf(LOG_MODULE_IOTIVITY, lvl, "%c", p[i]);
         } else {
-            log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "%02x", p[i]);
+            modlog_printf(LOG_MODULE_IOTIVITY, lvl, "%02x", p[i]);
         }
     }
-    log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "]\n");
+    modlog_printf(LOG_MODULE_IOTIVITY, lvl, "]\n");
 }
 
 void
-oc_log_bytes_mbuf(uint16_t lvl, struct os_mbuf *m, int off, int len,
+oc_log_bytes_mbuf(uint8_t lvl, struct os_mbuf *m, int off, int len,
                   int print_char)
 {
     int i;
     uint8_t tmp[4];
     int blen;
 
-    log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "[");
+    modlog_printf(LOG_MODULE_IOTIVITY, lvl, "[");
     while (len) {
         blen = len;
         if (blen > sizeof(tmp)) {
@@ -85,13 +85,13 @@ oc_log_bytes_mbuf(uint16_t lvl, struct os_mbuf *m, int off, int len,
         os_mbuf_copydata(m, off, blen, tmp);
         for (i = 0; i < blen; i++) {
             if (print_char) {
-                log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "%c", tmp[i]);
+                modlog_printf(LOG_MODULE_IOTIVITY, lvl, "%c", tmp[i]);
             } else {
-                log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "%02x", tmp[i]);
+                modlog_printf(LOG_MODULE_IOTIVITY, lvl, "%02x", tmp[i]);
             }
         }
         off += blen;
         len -= blen;
     }
-    log_printf(&oc_log, LOG_MODULE_IOTIVITY, lvl, "]\n");
+    modlog_printf(LOG_MODULE_IOTIVITY, lvl, "]\n");
 }
diff --git a/net/oic/src/port/mynewt/lora_adaptor.c b/net/oic/src/port/mynewt/lora_adaptor.c
index 4bca5ecbdd..489aa6b453 100644
--- a/net/oic/src/port/mynewt/lora_adaptor.c
+++ b/net/oic/src/port/mynewt/lora_adaptor.c
@@ -325,7 +325,7 @@ oc_lora_deliver(struct oc_lora_state *os)
     if (OS_MBUF_USRHDR_LEN(m) < sizeof(struct oc_endpoint_lora)) {
         n = os_msys_get_pkthdr(0, sizeof(struct oc_endpoint_lora));
         if (!n) {
-            OC_LOG_ERROR("oc_lora_deliver: Could not allocate mbuf\n");
+            OC_LOG(ERROR, "oc_lora_deliver: Could not allocate mbuf\n");
             STATS_INC(oc_lora_stats, ierr);
             os_mbuf_free_chain(m);
             return;
diff --git a/net/oic/src/port/mynewt/serial_adaptor.c b/net/oic/src/port/mynewt/serial_adaptor.c
index aaef53c00b..8251d08b66 100644
--- a/net/oic/src/port/mynewt/serial_adaptor.c
+++ b/net/oic/src/port/mynewt/serial_adaptor.c
@@ -114,7 +114,7 @@ oc_send_buffer_serial(struct os_mbuf *m)
 {
     /* send over the shell output */
     if (shell_nlip_output(m)) {
-        OC_LOG_ERROR("oc_transport_serial: nlip output failed\n");
+        OC_LOG(ERROR, "oc_transport_serial: nlip output failed\n");
     }
 }
 
@@ -133,7 +133,7 @@ oc_attempt_rx_serial(void)
 
     m = os_msys_get_pkthdr(0, sizeof(struct oc_endpoint_plain));
     if (!m) {
-        OC_LOG_ERROR("Could not allocate OC message buffer\n");
+        OC_LOG(ERROR, "Could not allocate OC message buffer\n");
         goto rx_attempt_err;
     }
     OS_MBUF_PKTHDR(m)->omp_len = OS_MBUF_PKTHDR(n)->omp_len;
diff --git a/net/oic/src/port/oc_assert.h b/net/oic/src/port/oc_assert.h
index 369a3d9482..a034500c3d 100644
--- a/net/oic/src/port/oc_assert.h
+++ b/net/oic/src/port/oc_assert.h
@@ -25,7 +25,7 @@ extern "C" {
 
 #define oc_abort(msg)                                                   \
     do {                                                                \
-      OC_LOG_ERROR("error: %s\nAbort.\n", msg);                         \
+      OC_LOG(ERROR, "error: %s\nAbort.\n", msg);                         \
       assert(0);                                                        \
   } while (0)
 
diff --git a/net/oic/src/security/oc_acl.h b/net/oic/src/security/oc_acl.h
index f6140a06d3..66e02ff72b 100644
--- a/net/oic/src/security/oc_acl.h
+++ b/net/oic/src/security/oc_acl.h
@@ -19,7 +19,6 @@
 
 #include "oc_ri.h"
 #include "oc_uuid.h"
-#include "port/oc_log.h"
 #include "util/oc_list.h"
 #include "util/oc_memb.h"
 #include <stdbool.h>
diff --git a/net/oic/src/security/oc_cred.c b/net/oic/src/security/oc_cred.c
index 3fef4d82c6..664646853b 100644
--- a/net/oic/src/security/oc_cred.c
+++ b/net/oic/src/security/oc_cred.c
@@ -22,7 +22,6 @@
 #include "oc_core_res.h"
 #include "oc_doxm.h"
 #include "oc_dtls.h"
-#include "port/oc_log.h"
 #include "util/oc_list.h"
 #include "util/oc_memb.h"
 
diff --git a/net/oic/src/security/oc_doxm.h b/net/oic/src/security/oc_doxm.h
index 88e1061ba6..4f0331e52f 100644
--- a/net/oic/src/security/oc_doxm.h
+++ b/net/oic/src/security/oc_doxm.h
@@ -18,7 +18,6 @@
 #define OC_DOXM_H_
 
 #include "oc_uuid.h"
-#include "port/oc_log.h"
 #include "util/oc_list.h"
 #include "util/oc_memb.h"
 
diff --git a/net/oic/src/security/oc_svr.c b/net/oic/src/security/oc_svr.c
index 52d96cb80e..3360091f92 100644
--- a/net/oic/src/security/oc_svr.c
+++ b/net/oic/src/security/oc_svr.c
@@ -24,7 +24,6 @@
 #include "oc_doxm.h"
 #include "oc_pstat.h"
 #include "oc_ri.h"
-#include "port/oc_log.h"
 
 // Multiple devices?
 // What methods do sec resources support
diff --git a/sys/log/full/include/log/log.h b/sys/log/full/include/log/log.h
index 2788bf344f..eacfaf5864 100644
--- a/sys/log/full/include/log/log.h
+++ b/sys/log/full/include/log/log.h
@@ -264,7 +264,30 @@ const char *log_module_get_name(uint8_t id);
 /* Log functions, manipulate a single log */
 int log_register(char *name, struct log *log, const struct log_handler *,
                  void *arg, uint8_t level);
-int log_append_typed(struct log *, uint8_t, uint8_t, uint8_t, void *, uint16_t);
+
+/**
+ * @brief Writes the raw contents of a flat buffer to the specified log.
+ *
+ * NOTE: The flat buffer must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  This padding is *not* reflected in the specified
+ * length.  So, to log the string "abc", you should pass the following
+ * arguments to this function:
+ *
+ *     data: <padding>abc   (total of `LOG_ENTRY_HDR_SIZE`+3 bytes.)
+ *     len: 3
+ *
+ * @param log                   The log to write to.
+ * @param module                The log module of the entry to write.
+ * @param level                 The severity of the log entry to write.
+ * @param etype                 The type of data being written; one of the
+ *                                  `LOG_ETYPE_[...]` constants.
+ * @param data                  The flat buffer to write.
+ * @param len                   The number of bytes in the *message body*.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
+int log_append_typed(struct log *log, uint8_t module, uint8_t level,
+                     uint8_t etype, void *data, uint16_t len);
 
 /**
  * @brief Logs the contents of the provided mbuf, only freeing the mbuf on
@@ -275,6 +298,13 @@ int log_append_typed(struct log *, uint8_t, uint8_t, uint8_t, void *, uint16_t);
  * modified by pullup operations.  The updated mbuf address is passed back to
  * the caller via a write to the supplied mbuf pointer-to-pointer.
  *
+ * NOTE: The mbuf must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  So, to log the string "abc", you should pass an mbuf
+ * with the following characteristics:
+ *
+ *     om_data: <padding>abc
+ *     om_len: `LOG_ENTRY_HDR_SIZE` + 3
+ *
  * @param log                   The log to write to.
  * @param module                The module ID of the entry to write.
  * @param level                 The severity of the entry to write; one of the
@@ -297,6 +327,13 @@ int log_append_mbuf_typed_no_free(struct log *log, uint8_t module,
  * Logs the contents of the provided mbuf.  This function always frees the mbuf
  * regardless of the outcome.
  *
+ * NOTE: The mbuf must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  So, to log the string "abc", you should pass an mbuf
+ * with the following characteristics:
+ *
+ *     om_data: <padding>abc
+ *     om_len: `LOG_ENTRY_HDR_SIZE` + 3
+ *
  * @param log                   The log to write to.
  * @param module                The module ID of the entry to write.
  * @param level                 The severity of the entry to write; one of the
@@ -310,8 +347,63 @@ int log_append_mbuf_typed_no_free(struct log *log, uint8_t module,
 int log_append_mbuf_typed(struct log *log, uint8_t module, uint8_t level,
                           uint8_t etype, struct os_mbuf *om);
 
+/**
+ * @brief Writes the contents of a flat buffer to the specified log.
+ *
+ * @param log                   The log to write to.
+ * @param module                The log module of the entry to write.
+ * @param level                 The severity of the log entry to write.
+ * @param etype                 The type of data being written; one of the
+ *                                  `LOG_ETYPE_[...]` constants.
+ * @param data                  The flat buffer to write.
+ * @param len                   The number of bytes in the message body.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
 int log_append_body(struct log *log, uint8_t module, uint8_t level,
                     uint8_t etype, const void *body, uint16_t body_len);
+
+/**
+ * @brief Logs the contents of the provided mbuf, only freeing the mbuf on
+ * failure.
+ *
+ * Logs the contents of the provided mbuf, only freeing the mbuf on failure.
+ * On success, the mbuf remains allocated, but its structure may have been
+ * modified by pullup operations.  The updated mbuf address is passed back to
+ * the caller via a write to the supplied mbuf pointer-to-pointer.
+ *
+ * @param log                   The log to write to.
+ * @param module                The module ID of the entry to write.
+ * @param level                 The severity of the entry to write; one of the
+ *                                  `LOG_LEVEL_[...]` constants.
+ * @param etype                 The type of data to write; one of the
+ *                                  `LOG_ETYPE_[...]` constants.
+ * @param om_ptr                Indirectly points to the mbuf to write.  This
+ *                                  function updates the mbuf address if it
+ *                                  changes.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
+int log_append_mbuf_body_no_free(struct log *log, uint8_t module,
+                                 uint8_t level, uint8_t etype,
+                                 struct os_mbuf *om);
+
+/**
+ * @brief Logs the contents of the provided mbuf.
+ *
+ * Logs the contents of the provided mbuf.  This function always frees the mbuf
+ * regardless of the outcome.
+ *
+ * @param log                   The log to write to.
+ * @param module                The module ID of the entry to write.
+ * @param level                 The severity of the entry to write; one of the
+ *                                  `LOG_LEVEL_[...]` constants.
+ * @param etype                 The type of data to write; one of the
+ *                                  `LOG_ETYPE_[...]` constants.
+ * @param om                    The mbuf to write.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
 int log_append_mbuf_body(struct log *log, uint8_t module, uint8_t level,
                          uint8_t etype, struct os_mbuf *om);
 
@@ -320,6 +412,25 @@ struct log *log_console_get(void);
 void log_console_init(void);
 #endif
 
+/**
+ * @brief Writes the raw contents of a flat buffer to the specified log.
+ *
+ * NOTE: The flat buffer must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  This padding is *not* reflected in the specified
+ * length.  So, to log the string "abc", you should pass the following
+ * arguments to this function:
+ *
+ *     data: <padding>abc   (total of `LOG_ENTRY_HDR_SIZE`+3 bytes.)
+ *     len: 3
+ *
+ * @param log                   The log to write to.
+ * @param module                The log module of the entry to write.
+ * @param level                 The severity of the log entry to write.
+ * @param data                  The flat buffer to write.
+ * @param len                   The number of byte in the *message body*.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
 static inline int
 log_append(struct log *log, uint8_t module, uint8_t level, void *data,
            uint16_t len)
@@ -327,6 +438,32 @@ log_append(struct log *log, uint8_t module, uint8_t level, void *data,
     return log_append_typed(log, module, level, LOG_ETYPE_STRING, data, len);
 }
 
+/**
+ * @brief Logs the contents of the provided mbuf, only freeing the mbuf on
+ * failure.
+ *
+ * Logs the contents of the provided mbuf, only freeing the mbuf on failure.
+ * On success, the mbuf remains allocated, but its structure may have been
+ * modified by pullup operations.  The updated mbuf address is passed back to
+ * the caller via a write to the supplied mbuf pointer-to-pointer.
+ *
+ * NOTE: The mbuf must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  So, to log the string "abc", you should pass an mbuf
+ * with the following characteristics:
+ *
+ *     om_data: <padding>abc
+ *     om_len: `LOG_ENTRY_HDR_SIZE` + 3
+ *
+ * @param log                   The log to write to.
+ * @param module                The module ID of the entry to write.
+ * @param level                 The severity of the entry to write; one of the
+ *                                  `LOG_LEVEL_[...]` constants.
+ * @param om_ptr                Indirectly points to the mbuf to write.  This
+ *                                  function updates the mbuf address if it
+ *                                  changes.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
 static inline int
 log_append_mbuf_no_free(struct log *log, uint8_t module, uint8_t level,
                         struct os_mbuf **om)
@@ -335,6 +472,27 @@ log_append_mbuf_no_free(struct log *log, uint8_t module, uint8_t level,
                                          om);
 }
 
+/**
+ * @brief Logs the contents of the provided mbuf.
+ *
+ * Logs the contents of the provided mbuf.  This function always frees the mbuf
+ * regardless of the outcome.
+ *
+ * NOTE: The mbuf must have an initial padding of length
+ * `LOG_ENTRY_HDR_SIZE`.  So, to log the string "abc", you should pass an mbuf
+ * with the following characteristics:
+ *
+ *     om_data: <padding>abc
+ *     om_len: `LOG_ENTRY_HDR_SIZE` + 3
+ *
+ * @param log                   The log to write to.
+ * @param module                The module ID of the entry to write.
+ * @param level                 The severity of the entry to write; one of the
+ *                                  `LOG_LEVEL_[...]` constants.
+ * @param om                    The mbuf to write.
+ *
+ * @return                      0 on success; nonzero on failure.
+ */
 static inline int
 log_append_mbuf(struct log *log, uint8_t module, uint8_t level,
                 struct os_mbuf *om)
@@ -343,7 +501,8 @@ log_append_mbuf(struct log *log, uint8_t module, uint8_t level,
 }
 
 #define LOG_PRINTF_MAX_ENTRY_LEN (128)
-void log_printf(struct log *log, uint16_t, uint16_t, char *, ...);
+void log_printf(struct log *log, uint8_t module, uint8_t level,
+        const char *msg, ...);
 int log_read(struct log *log, void *dptr, void *buf, uint16_t off,
         uint16_t len);
 
diff --git a/sys/log/full/src/log.c b/sys/log/full/src/log.c
index d87c6b8208..f7f7c0b5ce 100644
--- a/sys/log/full/src/log.c
+++ b/sys/log/full/src/log.c
@@ -446,34 +446,44 @@ log_append_mbuf_typed(struct log *log, uint8_t module, uint8_t level,
 }
 
 int
-log_append_mbuf_body(struct log *log, uint8_t module, uint8_t level,
-                     uint8_t etype, struct os_mbuf *om)
+log_append_mbuf_body_no_free(struct log *log, uint8_t module, uint8_t level,
+                             uint8_t etype, struct os_mbuf *om)
 {
     struct log_entry_hdr hdr;
     int rc;
 
     if (!log->l_log->log_append_mbuf_body) {
-        rc = SYS_ENOTSUP;
-        goto done;
+        return SYS_ENOTSUP;
     }
 
     rc = log_append_prepare(log, module, level, etype, &hdr);
     if (rc != 0) {
-        goto done;
+        return rc;
     }
 
     rc = log->l_log->log_append_mbuf_body(log, &hdr, om);
     if (rc != 0) {
-        goto done;
+        return rc;
     }
 
-done:
+    return 0;
+}
+
+int
+log_append_mbuf_body(struct log *log, uint8_t module, uint8_t level,
+                     uint8_t etype, struct os_mbuf *om)
+{
+    int rc;
+
+    rc = log_append_mbuf_body_no_free(log, module, level, etype, om);
     os_mbuf_free_chain(om);
+
     return rc;
 }
 
 void
-log_printf(struct log *log, uint16_t module, uint16_t level, char *msg, ...)
+log_printf(struct log *log, uint8_t module, uint8_t level,
+           const char *msg, ...)
 {
     va_list args;
     char buf[LOG_PRINTF_MAX_ENTRY_LEN];
diff --git a/sys/log/modlog/include/modlog/modlog.h b/sys/log/modlog/include/modlog/modlog.h
index 4345b62eb4..54689a4975 100644
--- a/sys/log/modlog/include/modlog/modlog.h
+++ b/sys/log/modlog/include/modlog/modlog.h
@@ -139,14 +139,6 @@ void modlog_clear(void);
 /**
  * @brief Writes the contents of a flat buffer to the specified log module.
  *
- * NOTE: The flat buffer must have an initial padding of length
- * `LOG_ENTRY_HDR_SIZE`.  This padding is *not* reflected in the specified
- * length.  So, to log the string "abc", you should pass the following
- * arguments to this function:
- *
- *     data: <padding>abc   (total of `LOG_ENTRY_HDR_SIZE`+3 bytes.)
- *     len: 3
- *
  * @param module                The log module to write to.
  * @param level                 The severity of the log entry to write.
  * @param etype                 The type of data being written; one of the
@@ -162,13 +154,6 @@ int modlog_append(uint8_t module, uint8_t level, uint8_t etype,
 /**
  * @brief Writes the contents of an mbuf to the specified log module.
  *
- * NOTE: The mbuf must have an initial padding of length
- * `LOG_ENTRY_HDR_SIZE`.  So, to log the string "abc", you should pass an mbuf
- * with the following characteristics:
- *
- *     om_data: <padding>abc
- *     om_len: `LOG_ENTRY_HDR_SIZE` + 3
- *
  * @param module                The log module to write to.
  * @param level                 The severity of the log entry to write.
  * @param etype                 The type of data being written; one of the
@@ -201,7 +186,7 @@ int modlog_foreach(modlog_foreach_fn *fn, void *arg);
  * @param level                 The severity of the log entry to write.
  * @param msg                   The "printf" formatted string to write.
  */
-void modlog_printf(uint16_t module, uint16_t level, const char *msg, ...);
+void modlog_printf(uint8_t module, uint8_t level, const char *msg, ...);
 
 #else /* LOG_FULL */
 
@@ -266,7 +251,7 @@ modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
  * @param ml_msg_               The "printf" formatted string to write.
  */
 #define MODLOG_DEBUG(ml_mod_, ml_msg_, ...) \
-    modlog_printf(ml_mod_, LOG_LEVEL_DEBUG, ml_msg_, ##__VA_ARGS__)
+    modlog_printf((ml_mod_), LOG_LEVEL_DEBUG, (ml_msg_), ##__VA_ARGS__)
 #else
 #define MODLOG_DEBUG(ml_mod_, ...) IGNORE(__VA_ARGS__)
 #endif
@@ -282,7 +267,7 @@ modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
  * @param ml_msg_               The "printf" formatted string to write.
  */
 #define MODLOG_INFO(ml_mod_, ml_msg_, ...) \
-    modlog_printf(ml_mod_, LOG_LEVEL_INFO, ml_msg_, ##__VA_ARGS__)
+    modlog_printf((ml_mod_), LOG_LEVEL_INFO, (ml_msg_), ##__VA_ARGS__)
 #else
 #define MODLOG_INFO(ml_mod_, ...) IGNORE(__VA_ARGS__)
 #endif
@@ -298,7 +283,7 @@ modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
  * @param ml_msg_               The "printf" formatted string to write.
  */
 #define MODLOG_WARN(ml_mod_, ml_msg_, ...) \
-    modlog_printf(ml_mod_, LOG_LEVEL_WARN, ml_msg_, ##__VA_ARGS__)
+    modlog_printf((ml_mod_), LOG_LEVEL_WARN, (ml_msg_), ##__VA_ARGS__)
 #else
 #define MODLOG_WARN(ml_mod_, ...) IGNORE(__VA_ARGS__)
 #endif
@@ -314,7 +299,7 @@ modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
  * @param ml_msg_               The "printf" formatted string to write.
  */
 #define MODLOG_ERROR(ml_mod_, ml_msg_, ...) \
-    modlog_printf(ml_mod_, LOG_LEVEL_ERROR, ml_msg_, ##__VA_ARGS__)
+    modlog_printf((ml_mod_), LOG_LEVEL_ERROR, (ml_msg_), ##__VA_ARGS__)
 #else
 #define MODLOG_ERROR(ml_mod_, ...) IGNORE(__VA_ARGS__)
 #endif
@@ -330,9 +315,48 @@ modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
  * @param ml_msg_               The "printf" formatted string to write.
  */
 #define MODLOG_CRITICAL(ml_mod_, ml_msg_, ...) \
-    modlog_printf(ml_mod_, LOG_LEVEL_CRITICAL, ml_msg_, ##__VA_ARGS__)
+    modlog_printf((ml_mod_), LOG_LEVEL_CRITICAL, (ml_msg_), ##__VA_ARGS__)
 #else
 #define MODLOG_CRITICAL(ml_mod_, ...) IGNORE(__VA_ARGS__)
 #endif
 
+/**
+ * @brief Writes a formatted text entry with the specified level to the
+ * specified log module.
+ *
+ * The provided log level must be one of the following tokens:
+ *     o CRITICAL
+ *     o ERROR
+ *     o WARN
+ *     o INFO
+ *     o DEBUG
+ *
+ * This expands to nothing if the global log level is greater than
+ * the specified level.
+ *
+ * @param ml_lvl_               The log level of the entry to write.
+ * @param ml_mod_               The log module to write to.
+ */
+#define MODLOG(ml_lvl_, ml_mod_, ...) \
+    MODLOG_ ## ml_lvl_((ml_mod_), __VA_ARGS__)
+
+/**
+ * @brief Writes a formatted text entry with the specified level to the
+ * default log module.
+ *
+ * The provided log level must be one of the following tokens:
+ *     o CRITICAL
+ *     o ERROR
+ *     o WARN
+ *     o INFO
+ *     o DEBUG
+ *
+ * This expands to nothing if the global log level is greater than
+ * the specified level.
+ *
+ * @param ml_lvl_               The log level of the entry to write.
+ */
+#define MODLOG_DFLT(ml_lvl_, ...) \
+    MODLOG(ml_lvl_, LOG_MODULE_DEFAULT, __VA_ARGS__)
+
 #endif
diff --git a/sys/log/modlog/src/modlog.c b/sys/log/modlog/src/modlog.c
index 3264b07ba8..6135547cc8 100644
--- a/sys/log/modlog/src/modlog.c
+++ b/sys/log/modlog/src/modlog.c
@@ -223,8 +223,7 @@ modlog_append_one(struct modlog_mapping *mm, uint8_t module, uint8_t level,
     int rc;
 
     if (level >= mm->desc.min_level) {
-        rc = log_append_typed(mm->desc.log, module,
-                              level, etype, data, len);
+        rc = log_append_body(mm->desc.log, module, level, etype, data, len);
         if (rc != 0) {
             return SYS_EIO;
         }
@@ -273,13 +272,13 @@ modlog_append_no_lock(uint8_t module, uint8_t level, uint8_t etype,
 
 static int
 modlog_append_mbuf_one(struct modlog_mapping *mm, uint8_t module,
-                       uint8_t level, uint8_t etype, struct os_mbuf **om)
+                       uint8_t level, uint8_t etype, struct os_mbuf *om)
 {
     int rc;
 
     if (level >= mm->desc.min_level) {
-        rc = log_append_mbuf_typed_no_free(mm->desc.log, module,
-                                           level, etype, om);
+        rc = log_append_mbuf_body_no_free(mm->desc.log, module,
+                                          level, etype, om);
         if (rc != 0) {
             return SYS_EIO;
         }
@@ -301,7 +300,7 @@ modlog_append_mbuf_no_lock(uint8_t module, uint8_t level, uint8_t etype,
         if (mm->desc.module == module) {
             found = true;
 
-            rc = modlog_append_mbuf_one(mm, module, level, etype, &om);
+            rc = modlog_append_mbuf_one(mm, module, level, etype, om);
             if (rc != 0) {
                 return rc;
             }
@@ -316,7 +315,7 @@ modlog_append_mbuf_no_lock(uint8_t module, uint8_t level, uint8_t etype,
              mm != NULL;
              mm = SLIST_NEXT(mm, next)) {
 
-            rc = modlog_append_mbuf_one(mm, module, level, etype, &om);
+            rc = modlog_append_mbuf_one(mm, module, level, etype, om);
             if (rc != 0) {
                 return rc;
             }
@@ -452,16 +451,14 @@ modlog_foreach(modlog_foreach_fn *fn, void *arg)
 }
 
 void
-modlog_printf(uint16_t module, uint16_t level, const char *msg, ...)
+modlog_printf(uint8_t module, uint8_t level, const char *msg, ...)
 {
     va_list args;
-    char buf[LOG_ENTRY_HDR_SIZE + MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN)];
+    char buf[MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN)];
     int len;
 
     va_start(args, msg);
-    len = vsnprintf(buf + LOG_ENTRY_HDR_SIZE,
-                    MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN),
-                    msg, args);
+    len = vsnprintf(buf, MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN), msg, args);
     va_end(args);
 
     if (len >= MYNEWT_VAL(MODLOG_MAX_PRINTF_LEN)) {
diff --git a/sys/log/modlog/test/src/modlog_test_util.c b/sys/log/modlog/test/src/modlog_test_util.c
index 6d1e2779e8..21ae5cc29a 100644
--- a/sys/log/modlog/test/src/modlog_test_util.c
+++ b/sys/log/modlog/test/src/modlog_test_util.c
@@ -22,52 +22,43 @@
 #include "modlog_test.h"
 
 static int
-mltu_log_append(struct log *log, void *buf, int len)
+mltu_log_append_body(struct log *log, const struct log_entry_hdr *hdr,
+                     const void *buf, int len)
 {
     struct mltu_log_entry *entry;
-    struct log_entry_hdr *hdr;
     struct mltu_log_arg *mla;
-    int body_len;
 
     mla = log->l_arg;
 
-    body_len = len - sizeof *hdr;
-
     TEST_ASSERT_FATAL(mla->num_entries < MLTU_LOG_ARG_MAX_ENTRIES);
-    TEST_ASSERT_FATAL(body_len <= MLTU_LOG_ENTRY_MAX_LEN);
+    TEST_ASSERT_FATAL(len <= MLTU_LOG_ENTRY_MAX_LEN);
 
     entry = mla->entries + mla->num_entries++;
-
-    hdr = buf;
     entry->hdr = *hdr;
-    entry->len = body_len;
-    memcpy(entry->body, hdr + 1, body_len);
+    entry->len = len;
+    memcpy(entry->body, buf, len);
 
     return 0;
 }
 
 static int
-mltu_log_append_mbuf(struct log *log, const struct os_mbuf *om)
+mltu_log_append_mbuf_body(struct log *log, const struct log_entry_hdr *hdr,
+                          const struct os_mbuf *om)
 {
     struct mltu_log_entry *entry;
     struct mltu_log_arg *mla;
-    int body_len;
     int rc;
 
     mla = log->l_arg;
 
-    body_len = OS_MBUF_PKTLEN(om) - sizeof entry->hdr;
-
     TEST_ASSERT_FATAL(mla->num_entries < MLTU_LOG_ARG_MAX_ENTRIES);
-    TEST_ASSERT_FATAL(body_len <= MLTU_LOG_ENTRY_MAX_LEN);
+    TEST_ASSERT_FATAL(OS_MBUF_PKTLEN(om) <= MLTU_LOG_ENTRY_MAX_LEN);
 
     entry = mla->entries + mla->num_entries++;
+    entry->hdr = *hdr;
+    entry->len = OS_MBUF_PKTLEN(om);
 
-    rc = os_mbuf_copydata(om, 0, sizeof entry->hdr, &entry->hdr);
-    TEST_ASSERT_FATAL(rc == 0);
-
-    entry->len = body_len;
-    rc = os_mbuf_copydata(om, sizeof entry->hdr, body_len, entry->body);
+    rc = os_mbuf_copydata(om, 0, OS_MBUF_PKTLEN(om), entry->body);
     TEST_ASSERT_FATAL(rc == 0);
 
     return 0;
@@ -75,8 +66,8 @@ mltu_log_append_mbuf(struct log *log, const struct os_mbuf *om)
 
 static const struct log_handler mltu_handler = {
     .log_type = LOG_TYPE_MEMORY,
-    .log_append = mltu_log_append,
-    .log_append_mbuf = mltu_log_append_mbuf,
+    .log_append_body = mltu_log_append_body,
+    .log_append_mbuf_body = mltu_log_append_mbuf_body,
 };
 
 void
@@ -89,36 +80,19 @@ mltu_register_log(struct log *lg, struct mltu_log_arg *arg, const char *name,
     TEST_ASSERT_FATAL(rc == 0);
 }
 
-struct os_mbuf *
-mltu_alloc_buf(void)
-{
-    struct os_mbuf *om;
-    uint8_t *u8p;
-
-    om = os_msys_get_pkthdr(0, 0);
-    TEST_ASSERT_FATAL(om != NULL);
-
-    u8p = os_mbuf_extend(om, sizeof (struct log_entry_hdr));
-    TEST_ASSERT_FATAL(u8p != NULL);
-
-    return om;
-}
-
 void
 mltu_append(uint8_t module, uint8_t level, uint8_t etype, void *data,
             int len, bool mbuf)
 {
-    uint8_t buf[1024];
     struct os_mbuf *om;
     int rc;
 
     if (!mbuf) {
-        TEST_ASSERT_FATAL(len + sizeof (struct log_entry_hdr) <= sizeof buf);
-        memcpy(buf + sizeof (struct log_entry_hdr), data, len);
-
-        rc = modlog_append(module, level, etype, buf, len);
+        rc = modlog_append(module, level, etype, data, len);
     } else {
-        om = mltu_alloc_buf();
+        om = os_msys_get_pkthdr(0, 0);
+        TEST_ASSERT_FATAL(om != NULL);
+
         rc = os_mbuf_append(om, data, len);
         TEST_ASSERT_FATAL(rc == 0);
 
diff --git a/sys/reboot/include/reboot/log_reboot.h b/sys/reboot/include/reboot/log_reboot.h
index d84148d64b..556672115c 100644
--- a/sys/reboot/include/reboot/log_reboot.h
+++ b/sys/reboot/include/reboot/log_reboot.h
@@ -33,7 +33,6 @@ extern "C" {
               (reason == HAL_RESET_REQUESTED ? "REQUESTED" :            \
                 "UNKNOWN"))))))
 
-int reboot_init_handler(int log_store_type, uint8_t entries);
 int log_reboot(enum hal_reset_reason);
 void reboot_start(enum hal_reset_reason reason);
 
diff --git a/sys/reboot/pkg.yml b/sys/reboot/pkg.yml
index 985fbc3199..1b05e29326 100644
--- a/sys/reboot/pkg.yml
+++ b/sys/reboot/pkg.yml
@@ -30,10 +30,10 @@ pkg.deps:
     - mgmt/imgmgr
     - sys/config
     - sys/flash_map
+    - sys/log/modlog
+
 pkg.deps.REBOOT_LOG_FCB:
     - fs/fcb
-pkg.req_apis:
-    - log
 
 pkg.init:
     log_reboot_pkg_init: 200
diff --git a/sys/reboot/src/log_reboot.c b/sys/reboot/src/log_reboot.c
index 86a3f647fd..670eb25e8a 100644
--- a/sys/reboot/src/log_reboot.c
+++ b/sys/reboot/src/log_reboot.c
@@ -20,7 +20,7 @@
 #include <string.h>
 #include <assert.h>
 #include "os/mynewt.h"
-#include "log/log.h"
+#include "modlog/modlog.h"
 #include "bootutil/image.h"
 #include "bootutil/bootutil.h"
 #include "imgmgr/imgmgr.h"
@@ -34,8 +34,6 @@
 #include "fcb/fcb.h"
 #endif
 
-static struct log_handler *reboot_log_handler;
-static struct log reboot_log;
 uint16_t reboot_cnt;
 static uint16_t soft_reboot;
 static char reboot_cnt_str[12];
@@ -55,78 +53,72 @@ struct conf_handler reboot_conf_handler = {
 
 #if MYNEWT_VAL(REBOOT_LOG_FCB)
 static struct fcb_log reboot_log_fcb;
+static struct log reboot_log;
 static struct flash_area sector;
 #endif
 
-/**
- * Reboot log initilization
- * @param type of log(console or storage); number of entries to restore
- * @return 0 on success; non-zero on failure
- */
-int
-reboot_init_handler(int log_store_type, uint8_t entries)
+
+#if MYNEWT_VAL(REBOOT_LOG_CONSOLE)
+static int
+log_reboot_init_console(void)
 {
-#if MYNEWT_VAL(REBOOT_LOG_FCB)
-    const struct flash_area *ptr;
-    struct fcb *fcbp = &reboot_log_fcb.fl_fcb;
-#endif
-    void *arg;
     int rc;
 
-    rc = conf_register(&reboot_conf_handler);
+    rc = modlog_register(LOG_MODULE_REBOOT, log_console_get(), LOG_SYSLEVEL,
+                         NULL);
     if (rc != 0) {
         return rc;
     }
 
-    switch (log_store_type) {
-#if MYNEWT_VAL(REBOOT_LOG_FCB)
-        case LOG_STORE_FCB:
-            if (flash_area_open(MYNEWT_VAL(REBOOT_LOG_FLASH_AREA), &ptr)) {
-                return rc;
-            }
-            fcbp = &reboot_log_fcb.fl_fcb;
-            sector = *ptr;
-            fcbp->f_sectors = &sector;
-            fcbp->f_sector_cnt = 1;
-            fcbp->f_magic = 0x7EADBADF;
-            fcbp->f_version = g_log_info.li_version;
-
-            reboot_log_fcb.fl_entries = entries;
-
-            rc = fcb_init(fcbp);
-            if (rc) {
-                flash_area_erase(ptr, 0, ptr->fa_size);
-                rc = fcb_init(fcbp);
-                if (rc) {
-                    return rc;
-                }
-            }
-            reboot_log_handler = (struct log_handler *)&log_fcb_handler;
-            if (rc) {
-                return rc;
-            }
-            arg = &reboot_log_fcb;
-            break;
-#endif
-#if MYNEWT_VAL(REBOOT_LOG_CONSOLE)
-       case LOG_STORE_CONSOLE:
-            reboot_log_handler = (struct log_handler *)&log_console_handler;
-            arg = NULL;
-            break;
+    return 0;
+
+}
 #endif
-       default:
-            assert(0);
+
+#if MYNEWT_VAL(REBOOT_LOG_FCB)
+static int
+log_reboot_init_fcb(void)
+{
+    const struct flash_area *ptr;
+    struct fcb *fcbp;
+    int rc;
+
+    if (flash_area_open(MYNEWT_VAL(REBOOT_LOG_FLASH_AREA), &ptr)) {
+        return SYS_EUNKNOWN;
+    }
+    fcbp = &reboot_log_fcb.fl_fcb;
+    sector = *ptr;
+    fcbp->f_sectors = &sector;
+    fcbp->f_sector_cnt = 1;
+    fcbp->f_magic = 0x7EADBADF;
+    fcbp->f_version = g_log_info.li_version;
+
+    reboot_log_fcb.fl_entries = MYNEWT_VAL(REBOOT_LOG_ENTRY_COUNT);
+
+    rc = fcb_init(fcbp);
+    if (rc) {
+        flash_area_erase(ptr, 0, ptr->fa_size);
+        rc = fcb_init(fcbp);
+        if (rc) {
+            return rc;
+        }
     }
 
-    rc = log_register("reboot_log", &reboot_log,
-                      (struct log_handler *)reboot_log_handler,
-                      arg, LOG_SYSLEVEL);
+    rc = log_register("reboot_log", &reboot_log, &log_fcb_handler,
+                      &reboot_log_fcb, LOG_SYSLEVEL);
+    if (rc != 0) {
+        return rc;
+    }
+
+    rc = modlog_register(LOG_MODULE_REBOOT, &reboot_log, LOG_SYSLEVEL,
+                         NULL);
     if (rc != 0) {
         return rc;
     }
 
     return 0;
 }
+#endif
 
 static int
 reboot_cnt_inc(void)
@@ -170,10 +162,10 @@ log_reboot(enum hal_reset_reason reason)
         imgr_my_version(&ver);
 
         /* Log a reboot */
-        LOG_CRITICAL(&reboot_log, LOG_MODULE_REBOOT, "rsn:%s, cnt:%u,"
-                     " img:%u.%u.%u.%u", REBOOT_REASON_STR(reason),
-                     reboot_cnt, ver.iv_major, ver.iv_minor,
-                     ver.iv_revision, (unsigned int)ver.iv_build_num);
+        MODLOG_CRITICAL(LOG_MODULE_REBOOT, "rsn:%s, cnt:%u,"
+                        " img:%u.%u.%u.%u", REBOOT_REASON_STR(reason),
+                        reboot_cnt, ver.iv_major, ver.iv_minor,
+                        ver.iv_revision, (unsigned int)ver.iv_build_num);
     }
 
     return 0;
@@ -237,24 +229,20 @@ reboot_conf_export(void (*func)(char *name, char *val),
 void
 log_reboot_pkg_init(void)
 {
-    int type;
     int rc;
 
     /* Ensure this function only gets called by sysinit. */
     SYSINIT_ASSERT_ACTIVE();
 
-    (void)rc;
-    (void)type;
+    rc = conf_register(&reboot_conf_handler);
+    SYSINIT_PANIC_ASSERT(rc == 0);
 
-#if MYNEWT_VAL(REBOOT_LOG_ENTRY_COUNT)
 #if MYNEWT_VAL(REBOOT_LOG_FCB)
-    type = LOG_STORE_FCB;
-#elif MYNEWT_VAL(REBOOT_LOG_CONSOLE)
-    type = LOG_STORE_CONSOLE;
-#else
-#error "sys/reboot included, but no log target"
+    rc = log_reboot_init_fcb();
+    SYSINIT_PANIC_ASSERT(rc == 0);
 #endif
-    rc = reboot_init_handler(type, MYNEWT_VAL(REBOOT_LOG_ENTRY_COUNT));
+#if MYNEWT_VAL(REBOOT_LOG_CONSOLE)
+    rc = log_reboot_init_console();
     SYSINIT_PANIC_ASSERT(rc == 0);
 #endif
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services