diff --git a/daemon/face/datagram-face.hpp b/daemon/face/datagram-face.hpp
index 339831c..4fb075e 100644
--- a/daemon/face/datagram-face.hpp
+++ b/daemon/face/datagram-face.hpp
@@ -28,7 +28,6 @@
 
 #include "face.hpp"
 #include "core/global-io.hpp"
-#include "core/logger.hpp"
 
 namespace nfd {
 
@@ -51,8 +50,6 @@
                const shared_ptr<typename protocol::socket>& socket,
                bool isOnDemand);
 
-  ~DatagramFace() DECL_OVERRIDE;
-
   // from Face
   void
   sendInterest(const Interest& interest) DECL_OVERRIDE;
@@ -68,15 +65,6 @@
                   size_t nBytesReceived,
                   const boost::system::error_code& error);
 
-  /**
-   * \brief Set m_hasBeenUsedRecently to false
-   */
-  void
-  resetRecentUsage();
-
-  bool
-  hasBeenUsedRecently() const;
-
   void
   setOnDemand(bool isOnDemand);
 
@@ -99,12 +87,23 @@
   void
   closeSocket();
 
+  bool
+  hasBeenUsedRecently() const;
+
+  /**
+   * \brief Set m_hasBeenUsedRecently to false
+   */
+  void
+  resetRecentUsage();
+
 protected:
   shared_ptr<typename protocol::socket> m_socket;
-  uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
-  bool m_hasBeenUsedRecently;
 
   NFD_LOG_INCLASS_DECLARE();
+
+private:
+  uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
+  bool m_hasBeenUsedRecently;
 };
 
 
@@ -116,6 +115,8 @@
   : Face(remoteUri, localUri)
   , m_socket(socket)
 {
+  NFD_LOG_FACE_INFO("Creating face");
+
   setOnDemand(isOnDemand);
 
   m_socket->async_receive(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
@@ -123,33 +124,29 @@
 }
 
 template<class T, class U>
-inline
-DatagramFace<T, U>::~DatagramFace()
-{
-}
-
-template<class T, class U>
 inline void
 DatagramFace<T, U>::sendInterest(const Interest& interest)
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendInterest, interest);
+
   const Block& payload = interest.wireEncode();
   m_socket->async_send(boost::asio::buffer(payload.wire(), payload.size()),
                        bind(&DatagramFace<T, U>::handleSend, this, _1, _2, payload));
-
-  // anything else should be done here?
 }
 
 template<class T, class U>
 inline void
 DatagramFace<T, U>::sendData(const Data& data)
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendData, data);
+
   const Block& payload = data.wireEncode();
   m_socket->async_send(boost::asio::buffer(payload.wire(), payload.size()),
                        bind(&DatagramFace<T, U>::handleSend, this, _1, _2, payload));
-
-  // anything else should be done here?
 }
 
 template<class T, class U>
@@ -159,18 +156,17 @@
   if (!m_socket->is_open())
     return;
 
-  NFD_LOG_INFO("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-               << "] Closing face");
+  NFD_LOG_FACE_INFO("Closing face");
 
   closeSocket();
-  fail("Face closed");
+  this->fail("Face closed");
 }
 
 template<class T, class U>
 inline void
 DatagramFace<T, U>::processErrorCode(const boost::system::error_code& error)
 {
-  if (error == boost::asio::error::operation_aborted) // when socket is closed by someone
+  if (error == boost::asio::error::operation_aborted) // when cancel() is called
     return;
 
   // this should be unnecessary, but just in case
@@ -180,16 +176,14 @@
   }
 
   if (error != boost::asio::error::eof)
-    NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                 << "] Send or receive operation failed, closing face: "
-                 << error.message());
+    NFD_LOG_FACE_WARN("Send or receive operation failed: " << error.message());
 
   closeSocket();
 
   if (error == boost::asio::error::eof)
     this->fail("Tunnel closed");
   else
-    this->fail("Send or receive operation failed: " + error.message());
+    this->fail(error.message());
 }
 
 template<class T, class U>
@@ -202,8 +196,7 @@
   if (error)
     return processErrorCode(error);
 
-  NFD_LOG_TRACE("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                << "] Successfully sent: " << nBytesSent << " bytes");
+  NFD_LOG_FACE_TRACE("Successfully sent: " << nBytesSent << " bytes");
   this->getMutableCounters().getNOutBytes() += nBytesSent;
 }
 
@@ -228,34 +221,28 @@
   if (error || nBytesReceived == 0)
     return processErrorCode(error);
 
-  NFD_LOG_TRACE("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                << "] Received: " << nBytesReceived << " bytes");
+  NFD_LOG_FACE_TRACE("Received: " << nBytesReceived << " bytes");
   this->getMutableCounters().getNInBytes() += nBytesReceived;
 
   Block element;
   bool isOk = Block::fromBuffer(buffer, nBytesReceived, element);
   if (!isOk)
     {
-      NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Failed to parse incoming packet");
+      NFD_LOG_FACE_WARN("Failed to parse incoming packet");
       // This message won't extend the face lifetime
       return;
     }
 
   if (element.size() != nBytesReceived)
     {
-      NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Received datagram size and decoded "
-                   << "element size don't match");
+      NFD_LOG_FACE_WARN("Received datagram size and decoded element size don't match");
       // This message won't extend the face lifetime
       return;
     }
 
   if (!this->decodeAndDispatchInput(element))
     {
-      NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Received unrecognized block of type ["
-                   << element.type() << "]");
+      NFD_LOG_FACE_WARN("Received unrecognized TLV block of type " << element.type());
       // This message won't extend the face lifetime
       return;
     }
@@ -267,12 +254,15 @@
 inline void
 DatagramFace<T, U>::keepFaceAliveUntilAllHandlersExecuted(const shared_ptr<Face>& face)
 {
+  NFD_LOG_FACE_TRACE(__func__);
 }
 
 template<class T, class U>
 inline void
 DatagramFace<T, U>::closeSocket()
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   // use the non-throwing variants and ignore errors, if any
   boost::system::error_code error;
   m_socket->shutdown(protocol::socket::shutdown_both, error);
@@ -293,19 +283,19 @@
 }
 
 template<class T, class U>
-inline void
-DatagramFace<T, U>::resetRecentUsage()
-{
-  m_hasBeenUsedRecently = false;
-}
-
-template<class T, class U>
 inline bool
 DatagramFace<T, U>::hasBeenUsedRecently() const
 {
   return m_hasBeenUsedRecently;
 }
 
+template<class T, class U>
+inline void
+DatagramFace<T, U>::resetRecentUsage()
+{
+  m_hasBeenUsedRecently = false;
+}
+
 } // namespace nfd
 
 #endif // NFD_DAEMON_FACE_DATAGRAM_FACE_HPP
diff --git a/daemon/face/ethernet-face.cpp b/daemon/face/ethernet-face.cpp
index 4994926..9ba95e0 100644
--- a/daemon/face/ethernet-face.cpp
+++ b/daemon/face/ethernet-face.cpp
@@ -25,7 +25,6 @@
 
 #include "ethernet-face.hpp"
 #include "core/global-io.hpp"
-#include "core/logger.hpp"
 
 #include <pcap/pcap.h>
 
@@ -79,8 +78,7 @@
   , m_nDropped(0)
 #endif
 {
-  NFD_LOG_INFO("Creating ethernet face on " << m_interfaceName << ": "
-               << m_srcAddress << " <--> " << m_destAddress);
+  NFD_LOG_FACE_INFO("Creating face on " << m_interfaceName << "/" << m_srcAddress);
   pcapInit();
 
   int fd = pcap_get_selectable_fd(m_pcap.get());
@@ -93,8 +91,7 @@
   m_socket->assign(::dup(fd));
 
   m_interfaceMtu = getInterfaceMtu();
-  NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName
-                << "] Interface MTU is: " << m_interfaceMtu);
+  NFD_LOG_FACE_DEBUG("Interface MTU is: " << m_interfaceMtu);
 
   m_slicer.reset(new ndnlp::Slicer(m_interfaceMtu));
 
@@ -108,8 +105,7 @@
 
   if (!m_destAddress.isBroadcast() && !joinMulticastGroup())
     {
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                   << "] Falling back to promiscuous mode");
+      NFD_LOG_FACE_WARN("Falling back to promiscuous mode");
       pcap_set_promisc(m_pcap.get(), 1);
     }
 
@@ -126,7 +122,10 @@
 void
 EthernetFace::sendInterest(const Interest& interest)
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendInterest, interest);
+
   ndnlp::PacketArray pa = m_slicer->slice(interest.wireEncode());
   for (const auto& packet : *pa) {
     sendPacket(packet);
@@ -136,7 +135,10 @@
 void
 EthernetFace::sendData(const Data& data)
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendData, data);
+
   ndnlp::PacketArray pa = m_slicer->slice(data.wireEncode());
   for (const auto& packet : *pa) {
     sendPacket(packet);
@@ -149,8 +151,7 @@
   if (!m_pcap)
     return;
 
-  NFD_LOG_INFO("[id:" << getId() << ",endpoint:" << m_interfaceName
-               << "] Closing face");
+  NFD_LOG_FACE_INFO("Closing face");
 
   boost::system::error_code error;
   m_socket->cancel(error); // ignore errors
@@ -184,8 +185,7 @@
 
   if (pcap_setdirection(m_pcap.get(), PCAP_D_IN) < 0)
     // no need to throw on failure, BPF will filter unwanted packets anyway
-    NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                 << "] pcap_setdirection failed: " << pcap_geterr(m_pcap.get()));
+    NFD_LOG_FACE_WARN("pcap_setdirection failed: " << pcap_geterr(m_pcap.get()));
 }
 
 void
@@ -215,8 +215,7 @@
                    PACKET_ADD_MEMBERSHIP, &mr, sizeof(mr)) == 0)
     return true; // success
 
-  NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-               << "] setsockopt(PACKET_ADD_MEMBERSHIP) failed: " << std::strerror(errno));
+  NFD_LOG_FACE_WARN("setsockopt(PACKET_ADD_MEMBERSHIP) failed: " << std::strerror(errno));
 #endif
 
 #if defined(SIOCADDMULTI)
@@ -262,8 +261,7 @@
   if (::ioctl(fd, SIOCADDMULTI, &ifr) == 0)
     return true; // success
 
-  NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-               << "] ioctl(SIOCADDMULTI) failed: " << std::strerror(errno));
+  NFD_LOG_FACE_WARN("ioctl(SIOCADDMULTI) failed: " << std::strerror(errno));
 #endif
 
   return false;
@@ -274,8 +272,7 @@
 {
   if (!m_pcap)
     {
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                   << "] Trying to send on closed face");
+      NFD_LOG_FACE_WARN("Trying to send on closed face");
       return fail("Face closed");
     }
 
@@ -309,8 +306,7 @@
       return fail("Failed to inject frame");
     }
 
-  NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
-                << "] Successfully sent: " << block.size() << " bytes");
+  NFD_LOG_FACE_TRACE("Successfully sent: " << block.size() << " bytes");
   this->getMutableCounters().getNOutBytes() += block.size();
 }
 
@@ -332,7 +328,7 @@
     }
   else if (ret == 0)
     {
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] Read timeout");
+      NFD_LOG_FACE_WARN("Read timeout");
     }
   else
     {
@@ -344,14 +340,12 @@
   ret = pcap_stats(m_pcap.get(), &ps);
   if (ret < 0)
     {
-      NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName
-                    << "] pcap_stats failed: " << pcap_geterr(m_pcap.get()));
+      NFD_LOG_FACE_DEBUG("pcap_stats failed: " << pcap_geterr(m_pcap.get()));
     }
   else if (ret == 0)
     {
       if (ps.ps_drop - m_nDropped > 0)
-        NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName
-                      << "] Detected " << ps.ps_drop - m_nDropped << " dropped packet(s)");
+        NFD_LOG_FACE_DEBUG("Detected " << ps.ps_drop - m_nDropped << " dropped packet(s)");
       m_nDropped = ps.ps_drop;
     }
 #endif
@@ -368,8 +362,7 @@
   size_t length = header->caplen;
   if (length < ethernet::HDR_LEN + ethernet::MIN_DATA_LEN)
     {
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                   << "] Received frame is too short (" << length << " bytes)");
+      NFD_LOG_FACE_WARN("Received frame is too short (" << length << " bytes)");
       return;
     }
 
@@ -392,15 +385,12 @@
   bool isOk = Block::fromBuffer(packet, length, fragment);
   if (!isOk)
     {
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                   << "] Block received from " << sourceAddress.toString()
-                   << " is invalid or too large to process");
+      NFD_LOG_FACE_WARN("Block received from " << sourceAddress.toString()
+                        << " is invalid or too large to process");
       return;
     }
 
-  NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
-                << "] Received: " << fragment.size() << " bytes from "
-                << sourceAddress.toString());
+  NFD_LOG_FACE_TRACE("Received: " << fragment.size() << " bytes from " << sourceAddress.toString());
   this->getMutableCounters().getNInBytes() += fragment.size();
 
   Reassembler& reassembler = m_reassemblers[sourceAddress];
@@ -410,12 +400,10 @@
       reassembler.pms.reset(new ndnlp::PartialMessageStore);
       reassembler.pms->onReceive.connect(
         [this, sourceAddress] (const Block& block) {
-          NFD_LOG_TRACE("[id:" << getId() << ",endpoint:" << m_interfaceName
-                        << "] All fragments received from " << sourceAddress.toString());
+          NFD_LOG_FACE_TRACE("All fragments received from " << sourceAddress.toString());
           if (!decodeAndDispatchInput(block))
-            NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                         << "] Received unrecognized TLV block of type " << block.type()
-                         << " from " << sourceAddress.toString());
+            NFD_LOG_FACE_WARN("Received unrecognized TLV block of type " << block.type()
+                              << " from " << sourceAddress.toString());
         });
     }
 
@@ -429,9 +417,8 @@
     reassembler.pms->receiveNdnlpData(fragment);
   }
   catch (const ndnlp::ParseError& e) {
-    NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-                 << "] Received invalid NDNLP fragment from "
-                 << sourceAddress.toString() << " : " << e.what());
+    NFD_LOG_FACE_WARN("Received invalid NDNLP fragment from "
+                      << sourceAddress.toString() << " : " << e.what());
   }
 }
 
@@ -446,12 +433,11 @@
   if (error == boost::asio::error::eof)
     {
       msg = "Face closed";
-      NFD_LOG_DEBUG("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
     }
   else
     {
       msg = "Receive operation failed: " + error.message();
-      NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName << "] " << msg);
+      NFD_LOG_FACE_WARN(msg);
     }
   fail(msg);
 }
@@ -475,8 +461,7 @@
   if (::ioctl(fd, SIOCGIFMTU, &ifr) == 0)
     return static_cast<size_t>(ifr.ifr_mtu);
 
-  NFD_LOG_WARN("[id:" << getId() << ",endpoint:" << m_interfaceName
-               << "] Failed to get interface MTU: " << std::strerror(errno));
+  NFD_LOG_FACE_WARN("Failed to get interface MTU: " << std::strerror(errno));
 #endif
 
   return ethernet::MAX_DATA_LEN;
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index e45fb1b..2b107a7 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -25,6 +25,8 @@
 
 #include "face.hpp"
 
+#include <ndn-cxx/management/nfd-face-event-notification.hpp>
+
 namespace nfd {
 
 Face::Face(const FaceUri& remoteUri, const FaceUri& localUri, bool isLocal)
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 2883770..142d14f 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -27,11 +27,11 @@
 #define NFD_DAEMON_FACE_FACE_HPP
 
 #include "common.hpp"
+#include "core/logger.hpp"
 #include "face-counters.hpp"
 
 #include <ndn-cxx/util/face-uri.hpp>
 #include <ndn-cxx/management/nfd-face-status.hpp>
-#include <ndn-cxx/management/nfd-face-event-notification.hpp>
 
 namespace nfd {
 
@@ -252,6 +252,39 @@
   return m_isOnDemand;
 }
 
+
+/** \defgroup FaceLogging Face logging macros
+ *
+ * These macros augment the log message with some face-specific information,
+ * such as the face ID, that are useful to distinguish which face produced the
+ * message. It is strongly recommended to use these macros instead of the
+ * generic ones for all logging inside Face subclasses.
+ * @{
+ */
+
+#define NFD_LOG_FACE(level, msg)                        \
+  NFD_LOG_##level("[id=" << this->getId() <<            \
+                  ",local=" << this->getLocalUri() <<   \
+                  ",remote=" << this->getRemoteUri() << \
+                  "] " << msg)
+
+/** \brief Log a message at TRACE level */
+#define NFD_LOG_FACE_TRACE(msg) NFD_LOG_FACE(TRACE, msg)
+
+/** \brief Log a message at DEBUG level */
+#define NFD_LOG_FACE_DEBUG(msg) NFD_LOG_FACE(DEBUG, msg)
+
+/** \brief Log a message at INFO level */
+#define NFD_LOG_FACE_INFO(msg)  NFD_LOG_FACE(INFO,  msg)
+
+/** \brief Log a message at WARN level */
+#define NFD_LOG_FACE_WARN(msg)  NFD_LOG_FACE(WARN,  msg)
+
+/** \brief Log a message at ERROR level */
+#define NFD_LOG_FACE_ERROR(msg) NFD_LOG_FACE(ERROR, msg)
+
+/** @} */
+
 } // namespace nfd
 
 #endif // NFD_DAEMON_FACE_FACE_HPP
diff --git a/daemon/face/multicast-udp-face.cpp b/daemon/face/multicast-udp-face.cpp
index aa1005e..9eb38c3 100644
--- a/daemon/face/multicast-udp-face.cpp
+++ b/daemon/face/multicast-udp-face.cpp
@@ -41,7 +41,7 @@
   , m_multicastGroup(multicastEndpoint)
   , m_sendSocket(sendSocket)
 {
-  NFD_LOG_INFO("Creating multicast UDP face for group " << m_multicastGroup);
+  NFD_LOG_FACE_INFO("Creating face");
 }
 
 const MulticastUdpFace::protocol::endpoint&
@@ -61,20 +61,22 @@
 void
 MulticastUdpFace::sendInterest(const Interest& interest)
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendInterest, interest);
 
-  NFD_LOG_DEBUG("Sending interest");
   sendBlock(interest.wireEncode());
 }
 
 void
 MulticastUdpFace::sendData(const Data& data)
 {
-  /// \todo After this method implements duplicate suppression, onSendData signal should
-  ///       be emitted only when data is actually sent out
+  NFD_LOG_FACE_TRACE(__func__);
+
+  /// \todo After this face implements duplicate suppression, onSendData should
+  ///       be emitted only when data is actually sent out. See also #2555
   this->emitSignal(onSendData, data);
 
-  NFD_LOG_DEBUG("Sending data");
   sendBlock(data.wireEncode());
 }
 
diff --git a/daemon/face/stream-face.hpp b/daemon/face/stream-face.hpp
index 255e8ee..0383d4c 100644
--- a/daemon/face/stream-face.hpp
+++ b/daemon/face/stream-face.hpp
@@ -29,7 +29,6 @@
 #include "face.hpp"
 #include "local-face.hpp"
 #include "core/global-io.hpp"
-#include "core/logger.hpp"
 
 namespace nfd {
 
@@ -49,8 +48,6 @@
              const shared_ptr<typename protocol::socket>& socket,
              bool isOnDemand);
 
-  ~StreamFace() DECL_OVERRIDE;
-
   // from FaceBase
   void
   sendInterest(const Interest& interest) DECL_OVERRIDE;
@@ -85,6 +82,8 @@
 protected:
   shared_ptr<typename protocol::socket> m_socket;
 
+  NFD_LOG_INCLASS_DECLARE();
+
 private:
   uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
   size_t m_inputBufferSize;
@@ -92,8 +91,6 @@
 
   friend struct StreamFaceSenderImpl<Protocol, FaceBase, Interest>;
   friend struct StreamFaceSenderImpl<Protocol, FaceBase, Data>;
-
-  NFD_LOG_INCLASS_DECLARE();
 };
 
 // All inherited classes must use
@@ -111,7 +108,7 @@
 struct StreamFaceValidator
 {
   static void
-  validateSocket(typename Protocol::socket& socket)
+  validateSocket(const typename Protocol::socket& socket)
   {
   }
 };
@@ -126,18 +123,15 @@
   , m_socket(socket)
   , m_inputBufferSize(0)
 {
+  NFD_LOG_FACE_INFO("Creating face");
+
   FaceBase::setOnDemand(isOnDemand);
   StreamFaceValidator<T, FaceBase>::validateSocket(*socket);
+
   m_socket->async_receive(boost::asio::buffer(m_inputBuffer, ndn::MAX_NDN_PACKET_SIZE), 0,
                           bind(&StreamFace<T, FaceBase>::handleReceive, this, _1, _2));
 }
 
-template<class T, class U>
-inline
-StreamFace<T, U>::~StreamFace()
-{
-}
-
 
 template<class Protocol, class FaceBase, class Packet>
 struct StreamFaceSenderImpl
@@ -178,6 +172,7 @@
 inline void
 StreamFace<T, U>::sendInterest(const Interest& interest)
 {
+  NFD_LOG_FACE_TRACE(__func__);
   this->emitSignal(onSendInterest, interest);
   StreamFaceSenderImpl<T, U, Interest>::send(*this, interest);
 }
@@ -186,6 +181,7 @@
 inline void
 StreamFace<T, U>::sendData(const Data& data)
 {
+  NFD_LOG_FACE_TRACE(__func__);
   this->emitSignal(onSendData, data);
   StreamFaceSenderImpl<T, U, Data>::send(*this, data);
 }
@@ -197,8 +193,7 @@
   if (!m_socket->is_open())
     return;
 
-  NFD_LOG_INFO("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-               << "] Closing face");
+  NFD_LOG_FACE_INFO("Closing face");
 
   shutdownSocket();
   this->fail("Face closed");
@@ -219,20 +214,14 @@
     }
 
   if (error != boost::asio::error::eof)
-    NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                 << "] Send or receive operation failed, closing face: "
-                 << error.message());
+    NFD_LOG_FACE_WARN("Send or receive operation failed: " << error.message());
 
   shutdownSocket();
 
   if (error == boost::asio::error::eof)
-    {
-      this->fail("Connection closed");
-    }
+    this->fail("Connection closed");
   else
-    {
-      this->fail("Send or receive operation failed: " + error.message());
-    }
+    this->fail(error.message());
 }
 
 template<class T, class U>
@@ -254,8 +243,7 @@
 
   BOOST_ASSERT(!m_sendQueue.empty());
 
-  NFD_LOG_TRACE("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                << "] Successfully sent: " << nBytesSent << " bytes");
+  NFD_LOG_FACE_TRACE("Successfully sent: " << nBytesSent << " bytes");
   this->getMutableCounters().getNOutBytes() += nBytesSent;
 
   m_sendQueue.pop();
@@ -271,8 +259,7 @@
   if (error)
     return processErrorCode(error);
 
-  NFD_LOG_TRACE("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                << "] Received: " << nBytesReceived << " bytes");
+  NFD_LOG_FACE_TRACE("Received: " << nBytesReceived << " bytes");
   this->getMutableCounters().getNInBytes() += nBytesReceived;
 
   m_inputBufferSize += nBytesReceived;
@@ -293,17 +280,13 @@
 
       if (!this->decodeAndDispatchInput(element))
         {
-          NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                       << "] Received unrecognized block of type ["
-                       << element.type() << "]");
+          NFD_LOG_FACE_WARN("Received unrecognized TLV block of type " << element.type());
           // ignore unknown packet and proceed
         }
     }
   if (!isOk && m_inputBufferSize == ndn::MAX_NDN_PACKET_SIZE && offset == 0)
     {
-      NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Failed to parse incoming packet or packet too large to process, "
-                   << "closing face");
+      NFD_LOG_FACE_WARN("Failed to parse incoming packet or packet too large to process");
       shutdownSocket();
       this->fail("Failed to parse incoming packet or packet too large to process");
       return;
@@ -332,6 +315,8 @@
 inline void
 StreamFace<T, U>::shutdownSocket()
 {
+  NFD_LOG_FACE_TRACE(__func__);
+
   // Cancel all outstanding operations and shutdown the socket
   // so that no further sends or receives are possible.
   // Use the non-throwing variants and ignore errors, if any.
@@ -361,8 +346,7 @@
 inline void
 StreamFace<T, U>::deferredClose(const shared_ptr<Face>& face)
 {
-  NFD_LOG_DEBUG("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                << "] Clearing send queue");
+  NFD_LOG_FACE_TRACE(__func__);
 
   // clear send queue
   std::queue<Block> emptyQueue;
diff --git a/daemon/face/tcp-face.hpp b/daemon/face/tcp-face.hpp
index 3eddde1..e4427de 100644
--- a/daemon/face/tcp-face.hpp
+++ b/daemon/face/tcp-face.hpp
@@ -40,7 +40,6 @@
           bool isOnDemand);
 };
 
-//
 
 /**
  * \brief Implementation of Face abstraction that uses TCP
@@ -58,19 +57,19 @@
 /** \brief Class validating use of TcpLocalFace
  */
 template<>
-struct StreamFaceValidator<boost::asio::ip::tcp, LocalFace>
+struct StreamFaceValidator<TcpLocalFace::protocol, LocalFace>
 {
   /** Check that local endpoint is loopback
    *
    *  @throws Face::Error if validation failed
    */
   static void
-  validateSocket(boost::asio::ip::tcp::socket& socket)
+  validateSocket(const TcpLocalFace::protocol::socket& socket)
   {
     if (!socket.local_endpoint().address().is_loopback() ||
         !socket.remote_endpoint().address().is_loopback())
       {
-        throw Face::Error("TcpLocalFace can be created only on loopback interface");
+        throw Face::Error("TcpLocalFace can be created only on a loopback address");
       }
   }
 };
diff --git a/daemon/face/udp-face.cpp b/daemon/face/udp-face.cpp
index 53dc374..8962f0d 100644
--- a/daemon/face/udp-face.cpp
+++ b/daemon/face/udp-face.cpp
@@ -63,8 +63,7 @@
   if (::setsockopt(socket->native_handle(), IPPROTO_IP,
                    IP_MTU_DISCOVER, &value, sizeof(value)) < 0)
     {
-      NFD_LOG_WARN("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Failed to disable path MTU discovery: " << std::strerror(errno));
+      NFD_LOG_FACE_WARN("Failed to disable path MTU discovery: " << std::strerror(errno));
     }
 #endif
 
@@ -108,14 +107,13 @@
   // (non-on-demand -> on-demand transition is not allowed)
   if (isOnDemand()) {
     if (!hasBeenUsedRecently()) {
-      NFD_LOG_INFO("[id:" << this->getId() << ",uri:" << this->getRemoteUri()
-                   << "] Idle for more than " << m_idleTimeout << ", closing");
+      NFD_LOG_FACE_INFO("Closing for inactivity");
       close();
 
       // #1718 manual test: uncomment, run NFD in valgrind, send in a UDP packet
       //                    expect read-after-free error and crash
       // getGlobalIoService().post([this] {
-      //   NFD_LOG_ERROR("Remaining references: " << this->shared_from_this().use_count());
+      //   NFD_LOG_FACE_ERROR("Remaining references: " << this->shared_from_this().use_count());
       // });
     }
     else {
diff --git a/daemon/face/udp-face.hpp b/daemon/face/udp-face.hpp
index 829b3bc..f6c3183 100644
--- a/daemon/face/udp-face.hpp
+++ b/daemon/face/udp-face.hpp
@@ -52,9 +52,9 @@
   closeIfIdle();
 
 private:
-  scheduler::EventId m_closeIfIdleEvent;
-  time::seconds m_idleTimeout;
+  const time::seconds m_idleTimeout;
   time::steady_clock::TimePoint m_lastIdleCheck;
+  scheduler::EventId m_closeIfIdleEvent;
 };
 
 } // namespace nfd
diff --git a/daemon/face/unix-stream-face.cpp b/daemon/face/unix-stream-face.cpp
index 93ff30e..60b2236 100644
--- a/daemon/face/unix-stream-face.cpp
+++ b/daemon/face/unix-stream-face.cpp
@@ -33,14 +33,15 @@
                                                 UnixStreamFace::protocol, LocalFace,
                                                 "UnixStreamFace");
 
-BOOST_STATIC_ASSERT((boost::is_same<UnixStreamFace::protocol::socket::native_handle_type,
-                     int>::value));
-
 UnixStreamFace::UnixStreamFace(const shared_ptr<UnixStreamFace::protocol::socket>& socket)
   : StreamFace<protocol, LocalFace>(FaceUri::fromFd(socket->native_handle()),
                                     FaceUri(socket->local_endpoint()),
                                     socket, true)
 {
+  static_assert(
+    std::is_same<std::remove_cv<protocol::socket::native_handle_type>::type, int>::value,
+    "The native handle type for UnixStreamFace sockets must be 'int'"
+  );
 }
 
 } // namespace nfd
diff --git a/daemon/face/websocket-face.cpp b/daemon/face/websocket-face.cpp
index 4875f6c..27a8f57 100644
--- a/daemon/face/websocket-face.cpp
+++ b/daemon/face/websocket-face.cpp
@@ -37,6 +37,7 @@
   , m_server(server)
   , m_closed(false)
 {
+  NFD_LOG_FACE_INFO("Creating face");
   this->setOnDemand(true);
 }
 
@@ -46,6 +47,8 @@
   if (m_closed)
     return;
 
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendInterest, interest);
 
   const Block& payload = interest.wireEncode();
@@ -56,7 +59,7 @@
                   websocketpp::frame::opcode::binary);
   }
   catch (const websocketpp::lib::error_code& e) {
-    NFD_LOG_WARN("Failed to send Interest: " << e << " (" << e.message() << ")");
+    NFD_LOG_FACE_WARN("Failed to send Interest: " << e << " (" << e.message() << ")");
   }
 }
 
@@ -66,6 +69,8 @@
   if (m_closed)
     return;
 
+  NFD_LOG_FACE_TRACE(__func__);
+
   this->emitSignal(onSendData, data);
 
   const Block& payload = data.wireEncode();
@@ -76,22 +81,24 @@
                   websocketpp::frame::opcode::binary);
   }
   catch (const websocketpp::lib::error_code& e) {
-    NFD_LOG_WARN("Failed to send Data: " << e << " (" << e.message() << ")");
+    NFD_LOG_FACE_WARN("Failed to send Data: " << e << " (" << e.message() << ")");
   }
 }
 
 void
 WebSocketFace::close()
 {
-  if (m_closed == false)
-    {
-      m_closed = true;
-      scheduler::cancel(m_pingEventId);
-      websocketpp::lib::error_code ecode;
-      m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ecode);
+  if (m_closed)
+    return;
 
-      fail("Face closed");
-    }
+  NFD_LOG_FACE_INFO("Closing face");
+
+  m_closed = true;
+  scheduler::cancel(m_pingEventId);
+  websocketpp::lib::error_code ecode;
+  m_server.close(m_handle, websocketpp::close::status::normal, "closed by nfd", ecode);
+
+  fail("Face closed");
 }
 
 void
@@ -100,13 +107,11 @@
   // Copy message into Face internal buffer
   if (msg.size() > ndn::MAX_NDN_PACKET_SIZE)
     {
-      NFD_LOG_WARN("[id:" << this->getId()
-                   << "] Received WebSocket message is too big (" << msg.size() << " bytes)");
+      NFD_LOG_FACE_WARN("Received WebSocket message is too big (" << msg.size() << " bytes)");
       return;
     }
 
-  NFD_LOG_TRACE("[id:" << this->getId()
-                << "] Received: " << msg.size() << " bytes");
+  NFD_LOG_FACE_TRACE("Received: " << msg.size() << " bytes");
   this->getMutableCounters().getNInBytes() += msg.size();
 
   // Try to parse message data
@@ -115,15 +120,13 @@
                                 msg.size(), element);
   if (!isOk)
     {
-      NFD_LOG_WARN("[id:" << this->getId()
-                   << "] Received block is invalid or too large to process");
+      NFD_LOG_FACE_WARN("Received block is invalid or too large to process");
       return;
     }
 
   if (!this->decodeAndDispatchInput(element))
     {
-      NFD_LOG_WARN("[id:" << this->getId()
-                   << "] Received unrecognized TLV block of type " << element.type());
+      NFD_LOG_FACE_WARN("Received unrecognized TLV block of type " << element.type());
       // ignore unknown packet and proceed
     }
 }
diff --git a/daemon/face/websocket-face.hpp b/daemon/face/websocket-face.hpp
index 711699b..7838572 100644
--- a/daemon/face/websocket-face.hpp
+++ b/daemon/face/websocket-face.hpp
@@ -27,7 +27,6 @@
 #define NFD_DAEMON_FACE_WEBSOCKET_FACE_HPP
 
 #include "face.hpp"
-#include "core/logger.hpp"
 #include "core/scheduler.hpp"
 
 #ifndef HAVE_WEBSOCKET
