diff --git a/app/channel.cpp b/app/channel.cpp
index 3134683..3c011fd 100644
--- a/app/channel.cpp
+++ b/app/channel.cpp
@@ -104,8 +104,6 @@
     int channel = (*p) & CHANNEL_MASK;
     std::string ethdevice = ipmi::network::ChanneltoEthernet(channel);
 
-    printf("IPMI APP GET CHANNEL INFO\n");
-
     // The supported channels numbers are those which are configured.
     // Channel Number E is used as way to identify the current channel
     // that the command is being is received from.
diff --git a/apphandler.cpp b/apphandler.cpp
index 057f578..e69829f 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -147,7 +147,7 @@
     ipmi_ret_t rc = IPMI_CC_OK;
     *data_len = 0;
 
-    printf("IPMI SET ACPI STATE Ignoring for now\n");
+    log<level::DEBUG>("IPMI SET ACPI STATE Ignoring for now\n");
     return rc;
 }
 
@@ -398,13 +398,12 @@
     ipmi_ret_t rc = IPMI_CC_OK;
     *data_len = 0;
 
-    printf("IPMI GET DEVICE GUID\n");
-
     // Call Get properties method with the interface and property name
     r = mapper_get_service(bus, objname, &busname);
     if (r < 0) {
-        fprintf(stderr, "Failed to get %s bus name: %s\n",
-                objname, strerror(-r));
+        log<level::ERR>("Failed to get bus name",
+                        entry("BUS=%s", objname),
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
     r = sd_bus_call_method(bus,busname,objname,iface,
@@ -412,7 +411,8 @@
                            chassis_iface, "uuid");
     if (r < 0)
     {
-        fprintf(stderr, "Failed to call Get Method: %s\n", strerror(-r));
+        log<level::ERR>("Failed to call Get Method",
+                        entry("ERRNO=0x%X", -r));
         rc = IPMI_CC_UNSPECIFIED_ERROR;
         goto finish;
     }
@@ -420,7 +420,8 @@
     r = sd_bus_message_read(reply, "v", "s", &uuid);
     if (r < 0 || uuid == NULL)
     {
-        fprintf(stderr, "Failed to get a response: %s", strerror(-r));
+        log<level::ERR>("Failed to get a response",
+                        entry("ERRNO=0x%X", -r));
         rc = IPMI_CC_RESPONSE_ERROR;
         goto finish;
     }
@@ -432,7 +433,8 @@
     if (id_octet == NULL)
     {
         // Error
-        fprintf(stderr, "Unexpected UUID format: %s", uuid);
+        log<level::ERR>("Unexpected UUID format",
+                        entry("UUID=%s", uuid));
         rc = IPMI_CC_RESPONSE_ERROR;
         goto finish;
     }
@@ -476,7 +478,6 @@
                              ipmi_request_t request, ipmi_response_t response,
                              ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    printf("Handling Netfn:[0x%X], Cmd:[0x%X]\n",netfn,cmd);
 
     // Status code.
     ipmi_ret_t rc = IPMI_CC_OK;
@@ -498,8 +499,6 @@
                               ipmi_request_t request, ipmi_response_t response,
                               ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    printf("Handling WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
-
     // Status code.
     ipmi_ret_t rc = IPMI_CC_INVALID;
 
@@ -579,9 +578,6 @@
 void register_netfn_app_functions()
 {
     // <Get BT Interface Capabilities>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_CAP_BIT);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_CAP_BIT,
                            NULL,
@@ -589,9 +585,6 @@
                            PRIVILEGE_USER);
 
     // <Wildcard Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_WILDCARD);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_WILDCARD,
                            NULL,
@@ -599,9 +592,6 @@
                            PRIVILEGE_USER);
 
     // <Reset Watchdog Timer>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_RESET_WD);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_RESET_WD,
                            NULL,
@@ -609,9 +599,6 @@
                            PRIVILEGE_OPERATOR);
 
     // <Set Watchdog Timer>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_SET_WD);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_SET_WD,
                            NULL,
@@ -626,9 +613,6 @@
                            PRIVILEGE_OPERATOR);
 
     // <Get Device ID>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_DEVICE_ID);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_DEVICE_ID,
                            NULL,
@@ -636,9 +620,6 @@
                            PRIVILEGE_USER);
 
     // <Get Self Test Results>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_SELF_TEST_RESULTS);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_SELF_TEST_RESULTS,
                            NULL,
@@ -646,9 +627,6 @@
                            PRIVILEGE_USER);
 
     // <Get Device GUID>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_DEVICE_GUID);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_DEVICE_GUID,
                            NULL,
@@ -656,9 +634,6 @@
                            PRIVILEGE_USER);
 
     // <Set ACPI Power State>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_SET_ACPI);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_SET_ACPI,
                            NULL,
@@ -666,9 +641,6 @@
                            PRIVILEGE_ADMIN);
 
     // <Get Channel Access>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_CHANNEL_ACCESS);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_CHANNEL_ACCESS,
                            NULL,
@@ -676,9 +648,6 @@
                            PRIVILEGE_USER);
 
     // <Get Channel Info Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_CHAN_INFO);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_CHAN_INFO,
                            NULL,
@@ -686,9 +655,6 @@
                            PRIVILEGE_USER);
 
     // <Get System GUID Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_APP,
-           IPMI_CMD_GET_SYS_GUID);
     ipmi_register_callback(NETFUN_APP,
                            IPMI_CMD_GET_SYS_GUID,
                            NULL,
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 43c3fe3..d392d55 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -145,8 +145,9 @@
 
     r = mapper_get_service(bus, settings_object_name, &connection);
     if (r < 0) {
-        fprintf(stderr, "Failed to get %s connection: %s\n",
-                settings_object_name, strerror(-r));
+    log<level::ERR>("Failed to get connection",
+                    entry("OBJ_NAME=%s", settings_object_name),
+                    entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -168,7 +169,8 @@
                            name);                                      /* second argument */
 
     if (r < 0) {
-        fprintf(stderr, "Failed to issue method call: %s\n", error.message);
+        log<level::ERR>("Failed to issue Get method call",
+                        entry("ERRNO=0x%X", r));
         goto finish;
     }
 
@@ -178,7 +180,8 @@
      */
     r = sd_bus_message_read(m, "v", "s", &temp_buf);
     if (r < 0) {
-        fprintf(stderr, "Failed to parse response message: %s\n", strerror(-r));
+        log<level::ERR>("Failed to parse response message",
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -188,7 +191,7 @@
         strcpy(*buf, temp_buf);
     }
      */
-    printf("IPMID boot option property get: {%s}.\n", (char *) temp_buf);
+
 
 finish:
     sd_bus_error_free(&error);
@@ -216,8 +219,9 @@
 
     r = mapper_get_service(bus, settings_object_name, &connection);
     if (r < 0) {
-        fprintf(stderr, "Failed to get %s connection: %s\n",
-                settings_object_name, strerror(-r));
+        log<level::ERR>("Failed to get connection",
+                        entry("OBJ_NAME=%s", settings_object_name),
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -241,12 +245,11 @@
                            value);                                     /* fourth argument */
 
     if (r < 0) {
-        fprintf(stderr, "Failed to issue method call: %s\n", error.message);
+        log<level::ERR>("Failed to issue Set method call",
+                        entry("ERRNO=0x%X", r));
         goto finish;
     }
 
-    printf("IPMID boot option property set: {%s}.\n", value);
-
     finish:
     sd_bus_error_free(&error);
     sd_bus_message_unref(m);
@@ -584,7 +587,6 @@
                                  ipmi_data_len_t data_len,
                                  ipmi_context_t context)
 {
-    printf("Handling CHASSIS WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
     // Status code.
     ipmi_ret_t rc = IPMI_CC_INVALID;
     *data_len = 0;
@@ -661,8 +663,8 @@
     if (rc < 0)
     {
         log<level::ERR>("Failed to get bus name",
-                        entry("ERROR=%s, OBJPATH=%s",
-                              strerror(-rc), HOST_STATE_MANAGER_ROOT));
+                        entry("ERRNO=0x%X, OBJPATH=%s",
+                              -rc, HOST_STATE_MANAGER_ROOT));
         return rc;
     }
 
@@ -683,8 +685,7 @@
     if(rc < 0)
     {
         log<level::ERR>("Failed to initiate transition",
-                        entry("ERROR=%s, REQUEST=%s",
-                              bus_error.message, request.c_str()));
+                        entry("ERRNO=0x%X, REQUEST=%s", -rc, request.c_str()));
     }
     else
     {
@@ -766,29 +767,32 @@
 
     r = mapper_get_service(bus, objname, &busname);
     if (r < 0) {
-        fprintf(stderr, "Failed to get bus name, return value: %s.\n", strerror(-r));
+        log<level::ERR>("Failed to get bus name",
+                        entry("ERRNO=0x%X", -r));
         rc = IPMI_CC_UNSPECIFIED_ERROR;
         goto finish;
     }
 
     r = sd_bus_get_property(bus, busname, objname, intf, "pgood", NULL, &reply, "i");
     if (r < 0) {
-        fprintf(stderr, "Failed to call sd_bus_get_property:%d,  %s\n", r, strerror(-r));
-        fprintf(stderr, "Bus: %s, Path: %s, Interface: %s\n",
-                busname, objname, intf);
+        log<level::ERR>("Failed to call sd_bus_get_property",
+                        entry("PROPERTY=%s","pgood"),
+                        entry("ERRNO=0x%X", -r),
+                        entry("BUS=%s", busname),
+                        entry("PATH=%s", objname),
+                        entry("INTERFACE=%s", intf));
         rc = IPMI_CC_UNSPECIFIED_ERROR;
         goto finish;
     }
 
     r = sd_bus_message_read(reply, "i", &pgood);
     if (r < 0) {
-        fprintf(stderr, "Failed to read sensor: %s\n", strerror(-r));
+        log<level::ERR>("Failed to read sensor:",
+                        entry("ERRNO=0x%X", -r));
         rc = IPMI_CC_UNSPECIFIED_ERROR;
         goto finish;
     }
 
-    printf("pgood is 0x%02x\n", pgood);
-
     s = dbusToIpmi.at(powerRestore);
 
     // Current Power State
@@ -899,7 +903,7 @@
     //if (r < 0)
     //{
     //    fprintf(stderr, "Failed to get %s bus name: %s\n",
-    //            SOFTOFF_OBJPATH, strerror(-r));
+    //            SOFTOFF_OBJPATH, -r);
     //    return r;
     //}
 
@@ -909,8 +913,8 @@
                                 soft_off_iface, property, "s", value);
     if (rc < 0)
     {
-        fprintf(stderr, "Failed to set property in SoftPowerOff object: %s\n",
-                strerror(-rc));
+        log<level::ERR>("Failed to set property in SoftPowerOff object",
+                        entry("ERRNO=0x%X", -rc));
     }
 
     //TODO openbmc/openbmc#1661 - Mapper refactor
@@ -958,7 +962,6 @@
 
     // Catch the actual operaton by peeking into request buffer
     uint8_t chassis_ctrl_cmd = *(uint8_t *)request;
-    printf("Chassis Control Command: Operation:[0x%X]\n",chassis_ctrl_cmd);
 
     switch(chassis_ctrl_cmd)
     {
@@ -1022,7 +1025,8 @@
 
         default:
         {
-            fprintf(stderr, "Invalid Chassis Control command:[0x%X] received\n",chassis_ctrl_cmd);
+            log<level::ERR>("Invalid Chassis Control command",
+                            entry("CMD=0x%X", chassis_ctrl_cmd));
             rc = -1;
         }
     }
@@ -1187,8 +1191,6 @@
     get_sys_boot_options_t *reqptr = (get_sys_boot_options_t*) request;
     IpmiValue bootOption = ipmiDefault;
 
-    printf("IPMI GET_SYS_BOOT_OPTIONS\n");
-
     memset(resp,0,sizeof(*resp));
     resp->version   = SET_PARM_VERSION;
     resp->parm      = 5;
@@ -1289,7 +1291,8 @@
 
         if (ret < 0) {
 
-            fprintf(stderr, "getHostNetworkData failed for get_sys_boot_options.\n");
+            log<level::ERR>(
+                        "getHostNetworkData failed for get_sys_boot_options.");
             rc = IPMI_CC_UNSPECIFIED_ERROR;
 
         }else
@@ -1297,7 +1300,8 @@
     }
 
     else {
-        fprintf(stderr, "Unsupported parameter 0x%x\n", reqptr->parameter);
+        log<level::ERR>("Unsupported parameter", entry(
+                        "PARAM=0x%x", reqptr->parameter));
     }
 
     if (p)
@@ -1441,7 +1445,8 @@
 
         int ret = setHostNetworkData(reqptr);
         if (ret < 0) {
-            fprintf(stderr, "setHostNetworkData failed for set_sys_boot_options.\n");
+            log<level::ERR>(
+                        "setHostNetworkData failed for set_sys_boot_options");
             rc = IPMI_CC_UNSPECIFIED_ERROR;
         }
     } else if (reqptr->parameter ==
@@ -1453,7 +1458,8 @@
         // flags.
         rc = IPMI_CC_OK;
     } else {
-        fprintf(stderr, "Unsupported parameter 0x%x\n", reqptr->parameter);
+        log<level::ERR>("Unsupported parameter", entry(
+            "PARAM=0x%x", reqptr->parameter));
         rc = IPMI_CC_PARM_NOT_SUPPORTED;
     }
 
@@ -1463,37 +1469,30 @@
 void register_netfn_chassis_functions()
 {
     // <Wildcard Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_WILDCARD);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_WILDCARD, NULL, ipmi_chassis_wildcard,
                            PRIVILEGE_USER);
 
     // Get Chassis Capabilities
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_GET_CHASSIS_CAP);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_CHASSIS_CAP, NULL, ipmi_get_chassis_cap,
                            PRIVILEGE_USER);
 
     // <Get System Boot Options>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_GET_SYS_BOOT_OPTIONS);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_GET_SYS_BOOT_OPTIONS, NULL,
                            ipmi_chassis_get_sys_boot_options, PRIVILEGE_OPERATOR);
 
     // <Get Chassis Status>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_CHASSIS_STATUS);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_CHASSIS_STATUS, NULL, ipmi_get_chassis_status,
                            PRIVILEGE_USER);
 
     // <Chassis Control>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_CHASSIS_CONTROL);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_CHASSIS_CONTROL, NULL, ipmi_chassis_control,
                            PRIVILEGE_OPERATOR);
 
     // <Chassis Identify>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_CHASSIS, IPMI_CMD_CHASSIS_IDENTIFY);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_CHASSIS_IDENTIFY, NULL,
                            ipmi_chassis_identify, PRIVILEGE_OPERATOR);
 
     // <Set System Boot Options>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n", NETFUN_CHASSIS, IPMI_CMD_SET_SYS_BOOT_OPTIONS);
     ipmi_register_callback(NETFUN_CHASSIS, IPMI_CMD_SET_SYS_BOOT_OPTIONS, NULL,
                            ipmi_chassis_set_sys_boot_options, PRIVILEGE_OPERATOR);
 }
diff --git a/dcmihandler.cpp b/dcmihandler.cpp
index 2f3eded..be3e27e 100644
--- a/dcmihandler.cpp
+++ b/dcmihandler.cpp
@@ -1506,50 +1506,36 @@
 void register_netfn_dcmi_functions()
 {
     // <Get Power Limit>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-            NETFUN_GRPEXT, dcmi::Commands::GET_POWER_LIMIT);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::GET_POWER_LIMIT,
                            NULL, getPowerLimit, PRIVILEGE_USER);
 
     // <Set Power Limit>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-            NETFUN_GRPEXT, dcmi::Commands::SET_POWER_LIMIT);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::SET_POWER_LIMIT,
                            NULL, setPowerLimit, PRIVILEGE_OPERATOR);
 
     // <Activate/Deactivate Power Limit>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-            NETFUN_GRPEXT, dcmi::Commands::APPLY_POWER_LIMIT);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::APPLY_POWER_LIMIT,
                            NULL, applyPowerLimit, PRIVILEGE_OPERATOR);
 
     // <Get Asset Tag>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-            NETFUN_GRPEXT, dcmi::Commands::GET_ASSET_TAG);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::GET_ASSET_TAG,
                            NULL, getAssetTag, PRIVILEGE_USER);
 
     // <Set Asset Tag>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-            NETFUN_GRPEXT, dcmi::Commands::SET_ASSET_TAG);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::SET_ASSET_TAG,
                            NULL, setAssetTag, PRIVILEGE_OPERATOR);
 
     // <Get Management Controller Identifier String>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-        NETFUN_GRPEXT, dcmi::Commands::GET_MGMNT_CTRL_ID_STR);
 
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::GET_MGMNT_CTRL_ID_STR,
         NULL, getMgmntCtrlIdStr, PRIVILEGE_USER);
 
     // <Set Management Controller Identifier String>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-        NETFUN_GRPEXT, dcmi::Commands::SET_MGMNT_CTRL_ID_STR);
     ipmi_register_callback(NETFUN_GRPEXT, dcmi::Commands::SET_MGMNT_CTRL_ID_STR,
         NULL, setMgmntCtrlIdStr, PRIVILEGE_ADMIN);
 
diff --git a/groupext.cpp b/groupext.cpp
index 5695d07..1166a3e 100644
--- a/groupext.cpp
+++ b/groupext.cpp
@@ -25,7 +25,6 @@
 void register_netfn_groupext_functions()
 {
     // <Group Extension Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_GRPEXT, GRPEXT_GET_GROUP_CMD);
     ipmi_register_callback(NETFUN_GRPEXT, GRPEXT_GET_GROUP_CMD, NULL, ipmi_groupext,
                            PRIVILEGE_USER);
 
diff --git a/host-cmd-manager.cpp b/host-cmd-manager.cpp
index 500e57d..799f9bf 100644
--- a/host-cmd-manager.cpp
+++ b/host-cmd-manager.cpp
@@ -46,7 +46,7 @@
     {
         // Just return a heartbeat in this case.  A spurious SMS_ATN was
         // asserted for the host (probably from a previous boot).
-        log<level::INFO>("Control Host work queue is empty!");
+        log<level::DEBUG>("Control Host work queue is empty!");
 
         return std::make_pair(CMD_HEARTBEAT, 0x00);
     }
@@ -95,7 +95,7 @@
 {
     if (this->workQueue.size() >= 1)
     {
-        log<level::INFO>("Asserting SMS Attention");
+        log<level::DEBUG>("Asserting SMS Attention");
 
         std::string IPMI_PATH("/org/openbmc/HostIpmi/1");
         std::string IPMI_INTERFACE("org.openbmc.HostIpmi");
@@ -124,14 +124,14 @@
             log<level::ERR>("Error in setting SMS attention");
             elog<InternalFailure>();
         }
-        log<level::INFO>("SMS Attention asserted");
+        log<level::DEBUG>("SMS Attention asserted");
     }
 }
 
 // Called by specific implementations that provide commands
 void Manager::execute(CommandHandler command)
 {
-    log<level::INFO>("Pushing cmd on to queue",
+    log<level::DEBUG>("Pushing cmd on to queue",
             entry("COMMAND=%d", std::get<0>(command).first));
 
     this->workQueue.emplace(command);
diff --git a/host-interface.cpp b/host-interface.cpp
index 5cd5a35..19ca291 100644
--- a/host-interface.cpp
+++ b/host-interface.cpp
@@ -55,7 +55,7 @@
 {
     using namespace phosphor::logging;
 
-    log<level::INFO>("Pushing cmd on to queue",
+    log<level::DEBUG>("Pushing cmd on to queue",
             entry("CONTROL_HOST_CMD=%s",
                   convertForMessage(command)));
 
diff --git a/ipmid.cpp b/ipmid.cpp
index 91bbbee..c48df3b 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -158,7 +158,9 @@
     auto iter = g_ipmid_router_map.find(netfn_and_cmd);
     if(iter != g_ipmid_router_map.end())
     {
-        fprintf(stderr,"ERROR : Duplicate registration for NetFn [0x%X], Cmd:[0x%X]\n",netfn, cmd);
+        log<level::ERR>("Duplicate registration",
+                        entry("NETFN=0x%X", netfn),
+                        entry("CMD=0x%X", cmd));
     }
     else
     {
@@ -183,8 +185,9 @@
         if (!std::binary_search(whitelist.cbegin(), whitelist.cend(),
                                         std::make_pair(netfn, cmd)))
         {
-            printf("Net function:[0x%X], Command:[0x%X] is not whitelisted\n",
-                                         netfn, cmd);
+            log<level::ERR>("Net function not whitelisted",
+                            entry("NETFN=0x%X", netfn),
+                            entry("CMD=0x%X", cmd));
             rc = IPMI_CC_INSUFFICIENT_PRIVILEGE;
             memcpy(response, &rc, IPMI_CC_LEN);
             *data_len = IPMI_CC_LEN;
@@ -199,8 +202,10 @@
     {
         /* By default should only print on failure to find wildcard command. */
 #ifdef __IPMI_DEBUG__
-        fprintf(stderr, "No registered handlers for NetFn:[0x%X], Cmd:[0x%X]"
-               " trying Wilcard implementation \n",netfn, cmd);
+        log<level::ERR>(
+              "No registered handlers for NetFn, trying Wilcard implementation",
+              entry("NET_FUN=0x%X", netfn)
+              entry("CMD=0x%X", IPMI_CMD_WILDCARD));
 #endif
 
         // Now that we did not find any specific [NetFn,Cmd], tuple, check for
@@ -208,7 +213,9 @@
         iter = g_ipmid_router_map.find(std::make_pair(netfn, IPMI_CMD_WILDCARD));
         if(iter == g_ipmid_router_map.end())
         {
-            fprintf(stderr, "No Registered handlers for NetFn:[0x%X],Cmd:[0x%X]\n",netfn, IPMI_CMD_WILDCARD);
+            log<level::ERR>("No Registered handlers for NetFn",
+                            entry("NET_FUN=0x%X", netfn),
+                            entry("CMD=0x%X", IPMI_CMD_WILDCARD));
 
             // Respond with a 0xC1
             memcpy(response, &rc, IPMI_CC_LEN);
@@ -219,7 +226,9 @@
 
 #ifdef __IPMI_DEBUG__
     // We have either a perfect match -OR- a wild card atleast,
-    printf("Calling Net function:[0x%X], Command:[0x%X]\n", netfn, cmd);
+    log<level::ERR>("Calling Net function",
+                    entry("NET_FUN=0x%X", netfn)
+                    entry("CMD=0x%X", cmd));
 #endif
 
     // Extract the map data onto appropriate containers
@@ -261,7 +270,8 @@
                                        DBUS_INTF,
                                        "sendMessage");
     if (r < 0) {
-        fprintf(stderr, "Failed to add the method object: %s\n", strerror(-r));
+        log<level::ERR>("Failed to add the method object",
+                        entry("ERRNO=0x%X", -r));
         return -1;
     }
 
@@ -273,13 +283,15 @@
     // Add the bytes needed for the methods to be called
     r = sd_bus_message_append(m, "yyyyy", seq, netfn, lun, cmd, cc);
     if (r < 0) {
-        fprintf(stderr, "Failed add the netfn and others : %s\n", strerror(-r));
+        log<level::ERR>("Failed add the netfn and others",
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
     r = sd_bus_message_append_array(m, 'y', buf, len);
     if (r < 0) {
-        fprintf(stderr, "Failed to add the string of response bytes: %s\n", strerror(-r));
+        log<level::ERR>("Failed to add the string of response bytes",
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
@@ -288,14 +300,17 @@
     // Call the IPMI responder on the bus so the message can be sent to the CEC
     r = sd_bus_call(bus, m, 0, &error, &reply);
     if (r < 0) {
-        fprintf(stderr, "Failed to call the method: %s\n", strerror(-r));
-        fprintf(stderr, "Dest: %s, Path: %s\n", dest, path);
+        log<level::ERR>("Failed to call the method",
+                        entry("DEST=%s", dest),
+                        entry("PATH=%s", path),
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
     r = sd_bus_message_read(reply, "x", &pty);
     if (r < 0) {
-       fprintf(stderr, "Failed to get a rc from the method: %s\n", strerror(-r));
+       log<level::ERR>("Failed to get a reply from the method",
+                        entry("ERRNO=0x%X", -r));
     }
 
 final:
@@ -360,13 +375,15 @@
 
     r = sd_bus_message_read(m, "yyyy",  &sequence, &netfn, &lun, &cmd);
     if (r < 0) {
-        fprintf(stderr, "Failed to parse signal message: %s\n", strerror(-r));
+        log<level::ERR>("Failed to parse signal message",
+                        entry("ERRNO=0x%X", -r));
         return -1;
     }
 
     r = sd_bus_message_read_array(m, 'y',  &request, &sz );
     if (r < 0) {
-        fprintf(stderr, "Failed to parse signal message: %s\n", strerror(-r));
+        log<level::ERR>("Failed to parse signal message",
+                        entry("ERRNO=0x%X", -r));
         return -1;
     }
 
@@ -382,7 +399,12 @@
     r = ipmi_netfn_router(netfn, cmd, (void *)request, (void *)response, &resplen);
     if(r != 0)
     {
-        fprintf(stderr,"ERROR:[0x%X] handling NetFn:[0x%X], Cmd:[0x%X]\n",r, netfn, cmd);
+#ifdef __IPMI_DEBUG__
+        log<level::ERR>("ERROR in handling NetFn",
+                        entry("ERRNO=0x%X", -r),
+                        entry("NET_FUN=0x%X", netfn),
+                        entry("CMD=0x%X", cmd));
+#endif
         resplen = 0;
     }
     else
@@ -397,7 +419,7 @@
     r = send_ipmi_message(m, sequence, netfn, lun, cmd, response[0],
 		    ((unsigned char *)response) + 1, resplen);
     if (r < 0) {
-        fprintf(stderr, "Failed to send the response message\n");
+        log<level::ERR>("Failed to send the response message");
         return -1;
     }
 
@@ -451,7 +473,7 @@
 
     if(ipmi_lib_path == NULL)
     {
-        fprintf(stderr,"ERROR; No handlers to be registered for ipmi.. Aborting\n");
+        log<level::ERR>("No handlers to be registered for ipmi.. Aborting");
         assert(0);
     }
     else
@@ -475,14 +497,18 @@
         {
             handler_fqdn = ipmi_lib_path;
             handler_fqdn += handler_list[num_handlers]->d_name;
-            printf("Registering handler:[%s]\n",handler_fqdn.c_str());
+#ifdef __IPMI_DEBUG__
+            log<level::DEBUG>("Registering handler",
+                              entry("HANDLER=%s", handler_fqdn.c_str()));
+#endif
 
             lib_handler = dlopen(handler_fqdn.c_str(), RTLD_NOW);
 
             if(lib_handler == NULL)
             {
-                fprintf(stderr,"ERROR opening [%s]: %s\n",
-                        handler_fqdn.c_str(), dlerror());
+                log<level::ERR>("ERROR opening",
+                                entry("HANDLER=%s", handler_fqdn.c_str()),
+                                entry("ERROR=%s", dlerror()));
             }
             // Wipe the memory allocated for this particular entry.
             free(handler_list[num_handlers]);
@@ -557,8 +583,8 @@
     /* Connect to system bus */
     r = sd_bus_open_system(&bus);
     if (r < 0) {
-        fprintf(stderr, "Failed to connect to system bus: %s\n",
-                strerror(-r));
+        log<level::ERR>("Failed to connect to system bus",
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -567,7 +593,7 @@
     if (r < 0)
     {
         log<level::ERR>("Failure to create sd_event handler",
-                entry("ERROR=%s", strerror(-r)));
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -583,7 +609,9 @@
 	// Watch for BT messages
     r = sd_bus_add_match(bus, &ipmid_slot, FILTER, handle_ipmi_command, NULL);
     if (r < 0) {
-        fprintf(stderr, "Failed: sd_bus_add_match: %s : %s\n", strerror(-r), FILTER);
+        log<level::ERR>("Failed: sd_bus_add_match",
+                        entry("FILTER=%s", FILTER),
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     }
 
@@ -613,7 +641,7 @@
             if (r < 0)
             {
                 log<level::ERR>("Failure in processing request",
-                        entry("ERROR=%s", strerror(-r)));
+                                entry("ERRNO=0x%X", -r));
                 goto finish;
             }
         }
diff --git a/ipmisensor.cpp b/ipmisensor.cpp
index 3bca4e7..2e987d0 100644
--- a/ipmisensor.cpp
+++ b/ipmisensor.cpp
@@ -238,19 +238,18 @@
 	return rc;
 }
 
-void debug_print_ok_to_dont_care(uint8_t stype, int offset)
-{
-	printf("LOOKATME: Sensor should not be reported:  Type 0x%02x, Offset 0x%02x\n",
-		stype, offset);
-}
-
 bool shouldReport(uint8_t sensorType, int offset, int *index) {
 
 	bool rc = false;
 
 	if (findindex(sensorType, offset, index)) { rc = true;	}
-
-	if (rc==false) { debug_print_ok_to_dont_care(sensorType, offset); }
+    if (rc == false) {
+#ifdef __IPMI_DEBUG__
+        log<level::DEBUG>("LOOKATME: Sensor should not be reported",
+                        entry("SENSORTYPE=0x%02x", sensorType),
+                        entry("OFFSET=0x%02x", offset));
+#endif
+        }
 
 	return rc;
 }
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 618aa54..1feef5b 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -408,7 +408,8 @@
 {
     sensor_data_t *reqptr = (sensor_data_t*)request;
 
-    printf("IPMI SET_SENSOR [0x%02x]\n",reqptr->sennum);
+    log<level::DEBUG>("IPMI SET_SENSOR",
+                      entry("SENSOR_NUM=0x%02x", reqptr->sennum));
 
     /*
      * This would support the Set Sensor Reading command for the presence
@@ -1002,29 +1003,21 @@
 void register_netfn_sen_functions()
 {
     // <Wildcard Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_SENSOR, IPMI_CMD_WILDCARD);
     ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_WILDCARD,
                            nullptr, ipmi_sen_wildcard,
                            PRIVILEGE_USER);
 
     // <Get Sensor Type>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_SENSOR, IPMI_CMD_GET_SENSOR_TYPE);
     ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_GET_SENSOR_TYPE,
                            nullptr, ipmi_sen_get_sensor_type,
                            PRIVILEGE_USER);
 
     // <Set Sensor Reading and Event Status>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_SENSOR, IPMI_CMD_SET_SENSOR);
     ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_SET_SENSOR,
                            nullptr, ipmi_sen_set_sensor,
                            PRIVILEGE_OPERATOR);
 
     // <Get Sensor Reading>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",
-           NETFUN_SENSOR, IPMI_CMD_GET_SENSOR_READING);
     ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_GET_SENSOR_READING,
                            nullptr, ipmi_sen_get_sensor_reading,
                            PRIVILEGE_USER);
diff --git a/softoff/mainapp.cpp b/softoff/mainapp.cpp
index c6c1858..3a47cc4 100644
--- a/softoff/mainapp.cpp
+++ b/softoff/mainapp.cpp
@@ -41,7 +41,7 @@
     if (r < 0)
     {
         log<level::ERR>("Failure to create sd_event handler",
-                entry("ERROR=%s", strerror(-r)));
+                entry("ERRNO=0x%X", -r));
         return -1;
     }
 
@@ -65,7 +65,7 @@
         if (r < 0)
         {
             log<level::ERR>("Failure in processing request",
-                    entry("ERROR=%s", strerror(-r)));
+                    entry("ERRNO=0x%X", -r));
             return -1;
         }
     }
diff --git a/softoff/softoff.cpp b/softoff/softoff.cpp
index 4a3166c..f76cd4f 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -81,7 +81,7 @@
         if (r < 0)
         {
             log<level::ERR>("Failure to start Host shutdown wait timer",
-                    entry("ERROR=%s", strerror(-r)));
+                    entry("ERRNO=0x%X", -r));
         }
         else
         {
@@ -120,7 +120,7 @@
         if (r < 0)
         {
             log<level::ERR>("Failure to STOP the timer",
-                    entry("ERROR=%s", strerror(-r)));
+                    entry("ERRNO=0x%X", -r));
         }
 
         // This marks the completion of soft power off sequence.
diff --git a/storageaddsel.cpp b/storageaddsel.cpp
index 2b41d56..c662502 100644
--- a/storageaddsel.cpp
+++ b/storageaddsel.cpp
@@ -94,20 +94,21 @@
 
 		r = fseek(fp, 0, SEEK_END);
 		if (r) {
-			fprintf(stderr,"Fseek failed\n");
+			log<level::ERR>("Fseek failed");
 			goto fclose_fp;
 		}
 
 		size = ftell(fp);
 		if (size == -1L) {
-			fprintf(stderr,"Ftell failed for %s\n", strerror(errno));
+			log<level::ERR>("Ftell failed",
+							entry("ERROR=%s", strerror(errno)));
 			size = 0;
 			goto fclose_fp;
 		}
 
 		r = fseek(fp, 0, SEEK_SET);
 		if (r) {
-			fprintf(stderr,"Fseek failed\n");
+			log<level::ERR>("Fseek failed");
 			size = 0;
 			goto fclose_fp;
 		}
@@ -117,7 +118,7 @@
 		r = fread(*buffer, 1, size, fp);
 		if ( r != size) {
 			size = 0;
-			fprintf(stderr,"Fread failed\n");
+			log<level::ERR>("Fread failed\n");
 		}
 
 fclose_fp:
@@ -181,8 +182,7 @@
 	r = asprintf(message, "A %s has experienced an error of level %d",
                      m, static_cast<uint32_t>(level) );
 	if (r == -1) {
-		fprintf(stderr,
-			"Failed to allocate memory for ESEL description\n");
+		log<level::ERR>("Failed to allocate memory for ESEL description");
 	}
 
 	free(m);
@@ -229,7 +229,8 @@
 
 	sz = getfilestream(path, &buffer);
 	if (sz == 0) {
-		printf("Error file does not exist %d\n",__LINE__);
+		log<level::ERR>("Error file does not exist",
+						entry("FILENAME=%s", path));
 		return;
 	}
 
@@ -239,7 +240,7 @@
 
 	r = send_esel_to_dbus(desc, sev, inventoryPath, buffer, sz);
 	if (r < 0) {
-		fprintf(stderr, "Failed to send esel to dbus\n");
+		log<level::ERR>("Failed to send esel to dbus");
 	}
 
 	free(desc);
diff --git a/storagehandler.cpp b/storagehandler.cpp
index b222fa7..d1392e6 100644
--- a/storagehandler.cpp
+++ b/storagehandler.cpp
@@ -79,7 +79,6 @@
                               ipmi_request_t request, ipmi_response_t response,
                               ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    printf("Handling STORAGE WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
     // Status code.
     ipmi_ret_t rc = IPMI_CC_INVALID;
     *data_len = 0;
@@ -435,8 +434,6 @@
     uint64_t host_time_usec = 0;
     uint32_t resp = 0;
 
-    printf("IPMI Handling GET-SEL-TIME\n");
-
     try
     {
         sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
@@ -472,8 +469,8 @@
         return IPMI_CC_UNSPECIFIED_ERROR;
     }
 
-    printf("Host time: %" PRIu64 ", %s",
-           host_time_usec, getTimeString(host_time_usec));
+    log<level::DEBUG>("Host time:",
+                      entry("HOST_TIME=%s", getTimeString(host_time_usec)));
 
     // Time is really long int but IPMI wants just uint32. This works okay until
     // the number of seconds since 1970 overflows uint32 size.. Still a whole
@@ -499,15 +496,9 @@
     uint32_t secs = *static_cast<uint32_t*>(request);
     *data_len = 0;
 
-    printf("Handling Set-SEL-Time:[0x%X], Cmd:[0x%X], Data:[0x%X]\n",
-           netfn, cmd, secs);
-
     secs = le32toh(secs);
     microseconds usec{seconds(secs)};
 
-    printf("To Set host time: %" PRIu64 ", %s",
-           usec.count(), getTimeString(usec.count()));
-
     try
     {
         sdbusplus::bus::bus bus{ipmid_get_sd_bus_connection()};
@@ -554,8 +545,6 @@
     if( ++g_sel_reserve == 0)
         g_sel_reserve = 1;
 
-    printf("IPMI Handling RESERVE-SEL 0x%04x\n", g_sel_reserve);
-
     *data_len = sizeof(g_sel_reserve);
 
     // Pack the actual response
@@ -575,8 +564,6 @@
 
     recordid = ((uint16_t)p->eventdata[1] << 8) | p->eventdata[2];
 
-    printf("IPMI Handling ADD-SEL for record 0x%04x\n", recordid);
-
     *data_len = sizeof(g_sel_reserve);
 
     // Pack the actual response
@@ -703,57 +690,44 @@
 void register_netfn_storage_functions()
 {
     // <Wildcard Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_WILDCARD);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_WILDCARD, NULL, ipmi_storage_wildcard,
                            PRIVILEGE_USER);
 
     // <Get SEL Info>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_INFO, NULL, getSELInfo,
                            PRIVILEGE_USER);
 
     // <Get SEL Time>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_TIME, NULL, ipmi_storage_get_sel_time,
                            PRIVILEGE_USER);
 
     // <Set SEL Time>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_SET_SEL_TIME, NULL, ipmi_storage_set_sel_time,
                            PRIVILEGE_OPERATOR);
 
     // <Reserve SEL>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_RESERVE_SEL, NULL, ipmi_storage_reserve_sel,
                            PRIVILEGE_USER);
 
     // <Get SEL Entry>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_GET_SEL_ENTRY);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_SEL_ENTRY, NULL, getSELEntry,
                            PRIVILEGE_USER);
 
     // <Delete SEL Entry>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_DELETE_SEL);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_DELETE_SEL, NULL, deleteSELEntry,
                            PRIVILEGE_OPERATOR);
 
     // <Add SEL Entry>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_ADD_SEL);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_ADD_SEL, NULL, ipmi_storage_add_sel,
                            PRIVILEGE_OPERATOR);
     // <Clear SEL>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_STORAGE, IPMI_CMD_CLEAR_SEL);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_CLEAR_SEL, NULL, clearSEL,
                            PRIVILEGE_OPERATOR);
     // <Get FRU Inventory Area Info>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n", NETFUN_STORAGE,
-            IPMI_CMD_GET_FRU_INV_AREA_INFO);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_GET_FRU_INV_AREA_INFO, NULL,
             ipmi_storage_get_fru_inv_area_info, PRIVILEGE_OPERATOR);
 
     // <Add READ FRU Data
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n", NETFUN_STORAGE,
-            IPMI_CMD_READ_FRU_DATA);
     ipmi_register_callback(NETFUN_STORAGE, IPMI_CMD_READ_FRU_DATA, NULL,
             ipmi_storage_read_fru_data, PRIVILEGE_OPERATOR);
 
diff --git a/systemintfcmds.cpp b/systemintfcmds.cpp
index b98ac12..d363233 100644
--- a/systemintfcmds.cpp
+++ b/systemintfcmds.cpp
@@ -25,8 +25,6 @@
 {
     ipmi_ret_t rc = IPMI_CC_OK;
 
-    printf("IPMI APP READ EVENT command received\n");
-
     struct oem_sel_timestamped oem_sel = {0};
     *data_len = sizeof(struct oem_sel_timestamped);
 
@@ -68,8 +66,6 @@
     // Generic return from IPMI commands.
     ipmi_ret_t rc = IPMI_CC_OK;
 
-    printf("IPMI APP GET MSG FLAGS returning with [bit:2] set\n");
-
     // From IPMI spec V2.0 for Get Message Flags Command :
     // bit:[1] from LSB : 1b = Event Message Buffer Full.
     // Return as 0 if Event Message Buffer is not supported,
@@ -93,7 +89,9 @@
     *data_len = 0;
 
     // Event and message logging enabled by default so return for now
+#ifdef __IPMI_DEBUG__
     printf("IPMI APP SET BMC GLOBAL ENABLES Ignoring for now\n");
+#endif
 
     return rc;
 }
@@ -111,18 +109,14 @@
 {
 
     // <Read Event Message Buffer>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_READ_EVENT);
     ipmi_register_callback(NETFUN_APP, IPMI_CMD_READ_EVENT, NULL, ipmi_app_read_event,
                            SYSTEM_INTERFACE);
 
     // <Set BMC Global Enables>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP,
-                                            IPMI_CMD_SET_BMC_GLOBAL_ENABLES);
     ipmi_register_callback(NETFUN_APP, IPMI_CMD_SET_BMC_GLOBAL_ENABLES, NULL,
                            ipmi_app_set_bmc_global_enables, SYSTEM_INTERFACE);
 
     // <Get Message Flags>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_MSG_FLAGS);
     ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_MSG_FLAGS, NULL, ipmi_app_get_msg_flags,
                            SYSTEM_INTERFACE);
 
diff --git a/testaddsel.cpp b/testaddsel.cpp
index 90f63a2..55cf07d 100644
--- a/testaddsel.cpp
+++ b/testaddsel.cpp
@@ -27,32 +27,37 @@
 
     r = mapper_get_service(bus, objname, &busname);
     if (r < 0) {
-        fprintf(stderr, "Failed to get %s busname: %s\n",
-                objname, strerror(-r));
+        log<level::ERR>("Failed to get busname",
+                        entry("BUS=%s", objname),
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
     r = sd_bus_message_new_method_call(bus,&m,busname,objname,busname,"getObjectFromByteId");
     if (r < 0) {
-        fprintf(stderr, "Failed to create a method call: %s", strerror(-r));
+        log<level::ERR>("Failed to create a method call",
+                        entry("ERRNO=0x%X", -r));
     }
 
     r = sd_bus_message_append(m, "sy", type, num);
     if (r < 0) {
-        fprintf(stderr, "Failed to create a input parameter: %s", strerror(-r));
+        log<level::ERR>("Failed to create a input parameter",
+                        entry("ERRNO=0x%X", -r));
     }
 
     // Call the IPMI responder on the bus so the message can be sent to the CEC
     r = sd_bus_call(bus, m, 0, &error, &reply);
     if (r < 0) {
-        fprintf(stderr, "Failed to call the method: %s", strerror(-r));
+        log<level::ERR>("Failed to call the method",
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
 
     r = sd_bus_message_read(reply, "(sss)", &str1, &str2, &str3);
     if (r < 0) {
-        fprintf(stderr, "Failed to get a response: %s", strerror(-r));
+        log<level::ERR>("Failed to get a response",
+                        entry("ERRNO=0x%X", -r));
         goto final;
     }
 
@@ -99,8 +104,8 @@
     /* Connect to system bus */
     r = sd_bus_open_system(&bus);
     if (r < 0) {
-        fprintf(stderr, "Failed to connect to system bus: %s\n",
-                strerror(-r));
+        log<level::ERR>("Failed to connect to system bus",
+                        entry("ERRNO=0x%X", -r));
         goto finish;
     } 
 
diff --git a/testit.cpp b/testit.cpp
index 072b5d7..37bb146 100644
--- a/testit.cpp
+++ b/testit.cpp
@@ -15,7 +15,7 @@
 uint8_t find_type_for_sensor_number(uint8_t sensor_number) {
 
     int i=0;
-    uint8_t rc; 
+    uint8_t rc;
 
     while (g_sensortype[i][0] != 0xff) {
         if (g_sensortype[i][1] == sensor_number) {
@@ -38,9 +38,6 @@
 
 
 int set_sensor_dbus_state_s(unsigned char number, const char *member, const char *value) {
-    printf("Attempting to log 0x%02x via %s with a value of %s\n",
-        number, member, value);
-
     strcpy(g_results_method, member);
     strcpy(g_results_value, value);
 
@@ -48,14 +45,10 @@
 }
 
 int set_sensor_dbus_state_y(unsigned char number, char const* member, uint8_t value) {
-    
+
     char val[2];
 
 
-    printf("Attempting to log Variant Sensor 0x%02x via %s with a value of 0x%02x\n",
-        number, member, value);
-
-
     snprintf(val, 2, "%d", value);
 
     strcpy(g_results_method, member);
@@ -81,7 +74,7 @@
 // Virtual Sensor 5, setting a Value of 0h
 uint8_t testrec_bootprogress[] = {0x05, 0xa9, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00};
 
-// Virtual Sensor setting a boot count 
+// Virtual Sensor setting a boot count
 uint8_t testrec_bootcount[]    = {0x01, 0x09, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
 // Invalid sensor number
@@ -89,12 +82,16 @@
 
 
 int check_results(int rc, const char *method, const char *value) {
-    if (strcmp(g_results_method, method)) { 
-        printf("ERROR: Method Failed, expect %s found %s\n", method, g_results_method);
+    if (strcmp(g_results_method, method)) {
+        log<level::ERR>("Method Failed",
+                        entry("EXPECT=%s", method),
+                        entry("GOT=%s", g_results_method));
         return -1;
     }
     if (strcmp(g_results_value, value)) {
-        printf("ERROR: Value failed, expected %s found %s\n", value, g_results_value);
+        log<level::ERR>("Value failed",
+                        entry("EXPECT=%s", value),
+                        entry("GOT=%s", g_results_method));
         return -2;
     }
 
diff --git a/transporthandler.cpp b/transporthandler.cpp
index 787a8fc..96a462d 100644
--- a/transporthandler.cpp
+++ b/transporthandler.cpp
@@ -361,7 +361,6 @@
                               ipmi_request_t request, ipmi_response_t response,
                               ipmi_data_len_t data_len, ipmi_context_t context)
 {
-    printf("Handling TRANSPORT WILDCARD Netfn:[0x%X], Cmd:[0x%X]\n",netfn, cmd);
     // Status code.
     ipmi_ret_t rc = IPMI_CC_INVALID;
     *data_len = 0;
@@ -965,17 +964,14 @@
     // so creating it here.
     createNetworkTimer();
     // <Wildcard Command>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_WILDCARD);
     ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_WILDCARD, NULL, ipmi_transport_wildcard,
                            PRIVILEGE_USER);
 
     // <Set LAN Configuration Parameters>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_SET_LAN);
     ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_SET_LAN, NULL, ipmi_transport_set_lan,
                            PRIVILEGE_ADMIN);
 
     // <Get LAN Configuration Parameters>
-    printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_TRANSPORT, IPMI_CMD_GET_LAN);
     ipmi_register_callback(NETFUN_TRANSPORT, IPMI_CMD_GET_LAN, NULL, ipmi_transport_get_lan,
                            PRIVILEGE_OPERATOR);
 
