diff --git a/src/dgraph/entity.cpp b/src/dgraph/entity.cpp
index 495cb9737cccb4c2542aad4a46e3d3dd678c84ea..e71eae1eac9a2fc2d80ed9c5c5041ee220d32735 100644
--- a/src/dgraph/entity.cpp
+++ b/src/dgraph/entity.cpp
@@ -209,5 +209,5 @@ Command *Entity::getNewStyleCommand(const std::string &commandName) {
 
 void Entity::sendMsg(const std::string &msg, MsgType t,
                      const std::string &lineId) {
-  logger_.sendMsg("[" + name + "]" + msg, t, lineId);
+  logger_.stream(t, lineId) << "[" << name << "]" << msg << '\n';
 }