diff --git a/daemon/face/channel-log.hpp b/daemon/face/channel-log.hpp
new file mode 100644
index 0000000..6092dad
--- /dev/null
+++ b/daemon/face/channel-log.hpp
@@ -0,0 +1,61 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2014-2017,  Regents of the University of California,
+ *                           Arizona Board of Regents,
+ *                           Colorado State University,
+ *                           University Pierre & Marie Curie, Sorbonne University,
+ *                           Washington University in St. Louis,
+ *                           Beijing Institute of Technology,
+ *                           The University of Memphis.
+ *
+ * This file is part of NFD (Named Data Networking Forwarding Daemon).
+ * See AUTHORS.md for complete list of NFD authors and contributors.
+ *
+ * NFD is free software: you can redistribute it and/or modify it under the terms
+ * of the GNU General Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ *
+ * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NFD_DAEMON_FACE_CHANNEL_LOG_HPP
+#define NFD_DAEMON_FACE_CHANNEL_LOG_HPP
+
+#include "core/logger.hpp"
+
+/** \defgroup ChannelLogging Channel logging macros
+ *
+ * These macros augment the log message with some channel-specific information,
+ * such as the local URI, that are useful to distinguish which channel produced
+ * the message. It is strongly recommended to use these macros instead of the
+ * generic ones for all logging inside Channel subclasses.
+ * @{
+ */
+
+/** \internal */
+#define NFD_LOG_CHAN(level, msg) NFD_LOG_##level( \
+  "[" << this->getUri() << "] " << msg)
+
+/** \brief Log a message at TRACE level */
+#define NFD_LOG_CHAN_TRACE(msg) NFD_LOG_CHAN(TRACE, msg)
+
+/** \brief Log a message at DEBUG level */
+#define NFD_LOG_CHAN_DEBUG(msg) NFD_LOG_CHAN(DEBUG, msg)
+
+/** \brief Log a message at INFO level */
+#define NFD_LOG_CHAN_INFO(msg)  NFD_LOG_CHAN(INFO,  msg)
+
+/** \brief Log a message at WARN level */
+#define NFD_LOG_CHAN_WARN(msg)  NFD_LOG_CHAN(WARN,  msg)
+
+/** \brief Log a message at ERROR level */
+#define NFD_LOG_CHAN_ERROR(msg) NFD_LOG_CHAN(ERROR, msg)
+
+/** @} */
+
+#endif // NFD_DAEMON_FACE_CHANNEL_LOG_HPP
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index ae3c583..a999b72 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -26,6 +26,7 @@
 #ifndef NFD_DAEMON_FACE_CHANNEL_HPP
 #define NFD_DAEMON_FACE_CHANNEL_HPP
 
+#include "channel-log.hpp"
 #include "face.hpp"
 
 namespace nfd {
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index cf0b34c..44282c0 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -26,7 +26,6 @@
 #include "ethernet-factory.hpp"
 #include "generic-link-service.hpp"
 #include "multicast-ethernet-transport.hpp"
-#include "core/logger.hpp"
 #include <boost/range/adaptors.hpp>
 #include <boost/range/algorithm/copy.hpp>
 
diff --git a/daemon/face/face-log.hpp b/daemon/face/face-log.hpp
index 6e0b3fd..51ff4c6 100644
--- a/daemon/face/face-log.hpp
+++ b/daemon/face/face-log.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -53,6 +53,9 @@
   const T& obj;
 };
 
+} // namespace face
+} // namespace nfd
+
 /** \defgroup FaceLogging Face logging macros
  *
  * These macros augment the log message with some face-specific information,
@@ -62,6 +65,7 @@
  * @{
  */
 
+/** \internal */
 #define NFD_LOG_FACE(level, msg) NFD_LOG_##level( \
   ::nfd::face::FaceLogHelper< \
     typename std::remove_cv< \
@@ -87,7 +91,4 @@
 
 /** @} */
 
-} // namespace face
-} // namespace nfd
-
 #endif // NFD_DAEMON_FACE_FACE_LOG_HPP
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index a955d97..ee44591 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -25,7 +25,6 @@
 
 #include "face-system.hpp"
 #include "protocol-factory.hpp"
-#include "core/logger.hpp"
 #include "fw/face-table.hpp"
 
 namespace nfd {
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 5486a43..4b99d2f 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+ * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -293,13 +293,6 @@
 std::ostream&
 operator<<(std::ostream& os, const FaceLogHelper<Face>& flh);
 
-template<typename T>
-typename std::enable_if<std::is_base_of<Face, T>::value, std::ostream&>::type
-operator<<(std::ostream& os, const FaceLogHelper<T>& flh)
-{
-  return os << FaceLogHelper<Face>(flh.obj);
-}
-
 } // namespace face
 
 using face::FaceId;
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 89d4a69..8a8622f 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -26,9 +26,6 @@
 #ifndef NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
 #define NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
 
-#include "core/common.hpp"
-#include "core/logger.hpp"
-
 #include "link-service.hpp"
 #include "lp-fragmenter.hpp"
 #include "lp-reassembler.hpp"
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index fb95099..aee7357 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -298,12 +298,5 @@
 {
 }
 
-std::ostream&
-operator<<(std::ostream& os, const FaceLogHelper<LpReliability>& flh)
-{
-  os << FaceLogHelper<LinkService>(*flh.obj.getLinkService());
-  return os;
-}
-
 } // namespace face
 } // namespace nfd
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index 47d5973..b3627a9 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -26,12 +26,9 @@
 #ifndef NFD_DAEMON_FACE_LP_RELIABILITY_HPP
 #define NFD_DAEMON_FACE_LP_RELIABILITY_HPP
 
-#include "core/common.hpp"
 #include "core/rtt-estimator.hpp"
 #include "core/scheduler.hpp"
 
-#include "face-log.hpp"
-
 #include <ndn-cxx/lp/packet.hpp>
 #include <ndn-cxx/lp/sequence.hpp>
 
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 978f540..f9a8eb7 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -38,9 +38,10 @@
 TcpChannel::TcpChannel(const tcp::Endpoint& localEndpoint)
   : m_localEndpoint(localEndpoint)
   , m_acceptor(getGlobalIoService())
-  , m_acceptSocket(getGlobalIoService())
+  , m_socket(getGlobalIoService())
 {
   setUri(FaceUri(m_localEndpoint));
+  NFD_LOG_CHAN_INFO("Creating channel");
 }
 
 void
@@ -49,20 +50,20 @@
                    int backlog/* = tcp::acceptor::max_connections*/)
 {
   if (isListening()) {
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Already listening");
+    NFD_LOG_CHAN_WARN("Already listening");
     return;
   }
 
   m_acceptor.open(m_localEndpoint.protocol());
   m_acceptor.set_option(ip::tcp::acceptor::reuse_address(true));
-  if (m_localEndpoint.address().is_v6())
+  if (m_localEndpoint.address().is_v6()) {
     m_acceptor.set_option(ip::v6_only(true));
-
+  }
   m_acceptor.bind(m_localEndpoint);
   m_acceptor.listen(backlog);
 
-  // start accepting connections
   accept(onFaceCreated, onAcceptFailed);
+  NFD_LOG_CHAN_DEBUG("Started listening");
 }
 
 void
@@ -74,25 +75,26 @@
 {
   auto it = m_channelFaces.find(remoteEndpoint);
   if (it != m_channelFaces.end()) {
+    NFD_LOG_CHAN_TRACE("Reusing existing face for " << remoteEndpoint);
     onFaceCreated(it->second);
     return;
   }
 
   auto clientSocket = make_shared<ip::tcp::socket>(ref(getGlobalIoService()));
+  auto timeoutEvent = scheduler::schedule(timeout, bind(&TcpChannel::handleConnectTimeout, this,
+                                                        remoteEndpoint, clientSocket, onConnectFailed));
 
-  scheduler::EventId connectTimeoutEvent = scheduler::schedule(timeout,
-    bind(&TcpChannel::handleConnectTimeout, this, clientSocket, onConnectFailed));
-
+  NFD_LOG_CHAN_TRACE("Connecting to " << remoteEndpoint);
   clientSocket->async_connect(remoteEndpoint,
                               bind(&TcpChannel::handleConnect, this,
-                                   boost::asio::placeholders::error, clientSocket,
-                                   wantLocalFieldsEnabled, connectTimeoutEvent,
+                                   boost::asio::placeholders::error, remoteEndpoint,
+                                   clientSocket, wantLocalFieldsEnabled, timeoutEvent,
                                    onFaceCreated, onConnectFailed));
 }
 
 void
 TcpChannel::createFace(ip::tcp::socket&& socket,
-                       bool isOnDemand,
+                       ndn::nfd::FacePersistency persistency,
                        bool wantLocalFieldsEnabled,
                        const FaceCreatedCallback& onFaceCreated)
 {
@@ -101,27 +103,21 @@
 
   auto it = m_channelFaces.find(remoteEndpoint);
   if (it == m_channelFaces.end()) {
-    auto persistency = isOnDemand ? ndn::nfd::FACE_PERSISTENCY_ON_DEMAND
-                                  : ndn::nfd::FACE_PERSISTENCY_PERSISTENT;
     auto linkService = make_unique<GenericLinkService>();
     auto options = linkService->getOptions();
     options.allowLocalFields = wantLocalFieldsEnabled;
     linkService->setOptions(options);
 
     auto transport = make_unique<TcpTransport>(std::move(socket), persistency);
-
     face = make_shared<Face>(std::move(linkService), std::move(transport));
 
     m_channelFaces[remoteEndpoint] = face;
-    connectFaceClosedSignal(*face,
-      [this, remoteEndpoint] {
-        NFD_LOG_TRACE("Erasing " << remoteEndpoint << " from channel face map");
-        m_channelFaces.erase(remoteEndpoint);
-      });
+    connectFaceClosedSignal(*face, [this, remoteEndpoint] { m_channelFaces.erase(remoteEndpoint); });
   }
   else {
     // we already have a face for this endpoint, just reuse it
     face = it->second;
+    NFD_LOG_CHAN_TRACE("Reusing existing face for " << remoteEndpoint);
 
     boost::system::error_code error;
     socket.shutdown(ip::tcp::socket::shutdown_both, error);
@@ -137,9 +133,9 @@
 TcpChannel::accept(const FaceCreatedCallback& onFaceCreated,
                    const FaceCreationFailedCallback& onAcceptFailed)
 {
-  m_acceptor.async_accept(m_acceptSocket, bind(&TcpChannel::handleAccept, this,
-                                               boost::asio::placeholders::error,
-                                               onFaceCreated, onAcceptFailed));
+  m_acceptor.async_accept(m_socket, bind(&TcpChannel::handleAccept, this,
+                                         boost::asio::placeholders::error,
+                                         onFaceCreated, onAcceptFailed));
 }
 
 void
@@ -148,18 +144,18 @@
                          const FaceCreationFailedCallback& onAcceptFailed)
 {
   if (error) {
-    if (error == boost::asio::error::operation_aborted) // when the socket is closed by someone
-      return;
-
-    NFD_LOG_DEBUG("[" << m_localEndpoint << "] Accept failed: " << error.message());
-    if (onAcceptFailed)
-      onAcceptFailed(500, "Accept failed: " + error.message());
+    if (error != boost::asio::error::operation_aborted) {
+      NFD_LOG_CHAN_DEBUG("Accept failed: " << error.message());
+      if (onAcceptFailed)
+        onAcceptFailed(500, "Accept failed: " + error.message());
+    }
     return;
   }
 
-  NFD_LOG_DEBUG("[" << m_localEndpoint << "] Connection from " << m_acceptSocket.remote_endpoint());
+  NFD_LOG_CHAN_TRACE("Incoming connection from " << m_socket.remote_endpoint());
 
-  createFace(std::move(m_acceptSocket), true, false, onFaceCreated);
+  createFace(std::move(m_socket), ndn::nfd::FACE_PERSISTENCY_ON_DEMAND,
+             false, onFaceCreated);
 
   // prepare accepting the next connection
   accept(onFaceCreated, onAcceptFailed);
@@ -167,6 +163,7 @@
 
 void
 TcpChannel::handleConnect(const boost::system::error_code& error,
+                          const tcp::Endpoint& remoteEndpoint,
                           const shared_ptr<ip::tcp::socket>& socket,
                           bool wantLocalFieldsEnabled,
                           const scheduler::EventId& connectTimeoutEvent,
@@ -184,35 +181,32 @@
 #else
   if (error) {
 #endif
-    if (error == boost::asio::error::operation_aborted) // when the socket is closed by someone
-      return;
-
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Connect failed: " << error.message());
-
-    socket->close();
-
-    if (onConnectFailed)
-      onConnectFailed(504, "Connect failed: " + error.message());
+    if (error != boost::asio::error::operation_aborted) {
+      NFD_LOG_CHAN_DEBUG("Connection to " << remoteEndpoint << " failed: " << error.message());
+      if (onConnectFailed)
+        onConnectFailed(504, "Connection failed: " + error.message());
+    }
     return;
   }
 
-  NFD_LOG_DEBUG("[" << m_localEndpoint << "] Connected to " << socket->remote_endpoint());
-
-  createFace(std::move(*socket), false, wantLocalFieldsEnabled, onFaceCreated);
+  NFD_LOG_CHAN_TRACE("Connected to " << socket->remote_endpoint());
+  createFace(std::move(*socket), ndn::nfd::FACE_PERSISTENCY_PERSISTENT,
+             wantLocalFieldsEnabled, onFaceCreated);
 }
 
 void
-TcpChannel::handleConnectTimeout(const shared_ptr<ip::tcp::socket>& socket,
+TcpChannel::handleConnectTimeout(const tcp::Endpoint& remoteEndpoint,
+                                 const shared_ptr<ip::tcp::socket>& socket,
                                  const FaceCreationFailedCallback& onConnectFailed)
 {
-  NFD_LOG_DEBUG("Connect to remote endpoint timed out");
+  NFD_LOG_CHAN_DEBUG("Connection to " << remoteEndpoint << " timed out");
 
   // abort the connection attempt
   boost::system::error_code error;
   socket->close(error);
 
   if (onConnectFailed)
-    onConnectFailed(504, "Connect to remote endpoint timed out");
+    onConnectFailed(504, "Connection timed out");
 }
 
 } // namespace face
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index 400cdf9..ea28c3e 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.hpp
@@ -95,7 +95,7 @@
 private:
   void
   createFace(boost::asio::ip::tcp::socket&& socket,
-             bool isOnDemand,
+             ndn::nfd::FacePersistency persistency,
              bool wantLocalFieldsEnabled,
              const FaceCreatedCallback& onFaceCreated);
 
@@ -110,6 +110,7 @@
 
   void
   handleConnect(const boost::system::error_code& error,
+                const tcp::Endpoint& remoteEndpoint,
                 const shared_ptr<boost::asio::ip::tcp::socket>& socket,
                 bool wantLocalFieldsEnabled,
                 const scheduler::EventId& connectTimeoutEvent,
@@ -117,15 +118,15 @@
                 const FaceCreationFailedCallback& onConnectFailed);
 
   void
-  handleConnectTimeout(const shared_ptr<boost::asio::ip::tcp::socket>& socket,
+  handleConnectTimeout(const tcp::Endpoint& remoteEndpoint,
+                       const shared_ptr<boost::asio::ip::tcp::socket>& socket,
                        const FaceCreationFailedCallback& onConnectFailed);
 
 private:
-  std::map<tcp::Endpoint, shared_ptr<Face>> m_channelFaces;
-
-  tcp::Endpoint m_localEndpoint;
+  const tcp::Endpoint m_localEndpoint;
   boost::asio::ip::tcp::acceptor m_acceptor;
-  boost::asio::ip::tcp::socket m_acceptSocket;
+  boost::asio::ip::tcp::socket m_socket;
+  std::map<tcp::Endpoint, shared_ptr<Face>> m_channelFaces;
 };
 
 } // namespace face
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index f87fbb6..5e8f3fb 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -24,7 +24,6 @@
  */
 
 #include "tcp-factory.hpp"
-#include "core/logger.hpp"
 
 namespace nfd {
 namespace face {
@@ -229,8 +228,6 @@
   channel = make_shared<TcpChannel>(endpoint);
   m_channels[endpoint] = channel;
   prohibitEndpoint(endpoint);
-
-  NFD_LOG_DEBUG("Channel [" << endpoint << "] created");
   return channel;
 }
 
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index d22b23c..e1bcd35 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -42,6 +42,7 @@
   , m_idleFaceTimeout(timeout)
 {
   setUri(FaceUri(m_localEndpoint));
+  NFD_LOG_CHAN_INFO("Creating channel");
 }
 
 void
@@ -55,9 +56,9 @@
     face = createFace(remoteEndpoint, persistency).second;
   }
   catch (const boost::system::system_error& e) {
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Connect failed: " << e.what());
+    NFD_LOG_CHAN_DEBUG("Face creation for " << remoteEndpoint << " failed: " << e.what());
     if (onConnectFailed)
-      onConnectFailed(504, std::string("Connect failed: ") + e.what());
+      onConnectFailed(504, std::string("Face creation failed: ") + e.what());
     return;
   }
 
@@ -68,20 +69,22 @@
 
 void
 UdpChannel::listen(const FaceCreatedCallback& onFaceCreated,
-                   const FaceCreationFailedCallback& onReceiveFailed)
+                   const FaceCreationFailedCallback& onFaceCreationFailed)
 {
   if (isListening()) {
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Already listening");
+    NFD_LOG_CHAN_WARN("Already listening");
     return;
   }
 
   m_socket.open(m_localEndpoint.protocol());
   m_socket.set_option(ip::udp::socket::reuse_address(true));
-  if (m_localEndpoint.address().is_v6())
+  if (m_localEndpoint.address().is_v6()) {
     m_socket.set_option(ip::v6_only(true));
-
+  }
   m_socket.bind(m_localEndpoint);
-  this->waitForNewPeer(onFaceCreated, onReceiveFailed);
+
+  waitForNewPeer(onFaceCreated, onFaceCreationFailed);
+  NFD_LOG_CHAN_DEBUG("Started listening");
 }
 
 void
@@ -103,16 +106,15 @@
                           const FaceCreationFailedCallback& onReceiveFailed)
 {
   if (error) {
-    if (error == boost::asio::error::operation_aborted) // when the socket is closed by someone
-      return;
-
-    NFD_LOG_DEBUG("[" << m_localEndpoint << "] Receive failed: " << error.message());
-    if (onReceiveFailed)
-      onReceiveFailed(500, "Receive failed: " + error.message());
+    if (error != boost::asio::error::operation_aborted) {
+      NFD_LOG_CHAN_DEBUG("Receive failed: " << error.message());
+      if (onReceiveFailed)
+        onReceiveFailed(500, "Receive failed: " + error.message());
+    }
     return;
   }
 
-  NFD_LOG_DEBUG("[" << m_localEndpoint << "] New peer " << m_remoteEndpoint);
+  NFD_LOG_CHAN_TRACE("New peer " << m_remoteEndpoint);
 
   bool isCreated = false;
   shared_ptr<Face> face;
@@ -120,10 +122,9 @@
     std::tie(isCreated, face) = createFace(m_remoteEndpoint, ndn::nfd::FACE_PERSISTENCY_ON_DEMAND);
   }
   catch (const boost::system::system_error& e) {
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Failed to create face for peer "
-                 << m_remoteEndpoint << ": " << e.what());
+    NFD_LOG_CHAN_DEBUG("Face creation for " << m_remoteEndpoint << " failed: " << e.what());
     if (onReceiveFailed)
-      onReceiveFailed(504, "Failed to create face for peer");
+      onReceiveFailed(504, std::string("Face creation failed: ") + e.what());
     return;
   }
 
@@ -131,17 +132,20 @@
     onFaceCreated(face);
 
   // dispatch the datagram to the face for processing
-  static_cast<UnicastUdpTransport*>(face->getTransport())->receiveDatagram(m_inputBuffer, nBytesReceived, error);
+  auto* transport = static_cast<UnicastUdpTransport*>(face->getTransport());
+  transport->receiveDatagram(m_inputBuffer, nBytesReceived, error);
 
-  this->waitForNewPeer(onFaceCreated, onReceiveFailed);
+  waitForNewPeer(onFaceCreated, onReceiveFailed);
 }
 
 std::pair<bool, shared_ptr<Face>>
-UdpChannel::createFace(const udp::Endpoint& remoteEndpoint, ndn::nfd::FacePersistency persistency)
+UdpChannel::createFace(const udp::Endpoint& remoteEndpoint,
+                       ndn::nfd::FacePersistency persistency)
 {
   auto it = m_channelFaces.find(remoteEndpoint);
   if (it != m_channelFaces.end()) {
     // we already have a face for this endpoint, so reuse it
+    NFD_LOG_CHAN_TRACE("Reusing existing face for " << remoteEndpoint);
     return {false, it->second};
   }
 
@@ -156,11 +160,7 @@
   auto face = make_shared<Face>(std::move(linkService), std::move(transport));
 
   m_channelFaces[remoteEndpoint] = face;
-  connectFaceClosedSignal(*face,
-    [this, remoteEndpoint] {
-      NFD_LOG_TRACE("Erasing " << remoteEndpoint << " from channel face map");
-      m_channelFaces.erase(remoteEndpoint);
-    });
+  connectFaceClosedSignal(*face, [this, remoteEndpoint] { m_channelFaces.erase(remoteEndpoint); });
 
   return {true, face};
 }
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index fe849a6..c4d261e 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -77,18 +77,16 @@
   /**
    * \brief Enable listening on the local endpoint, accept connections,
    *        and create faces when remote host makes a connection
-   * \param onFaceCreated  Callback to notify successful creation of the face
-   * \param onReceiveFailed Callback to notify when channel fails
+   *
+   * \param onFaceCreated Callback to notify successful creation of a face
+   * \param onFaceCreationFailed Callback to notify errors
    *
    * Once a face is created, if it doesn't send/receive anything for
    * a period of time equal to timeout, it will be destroyed
-   * \todo this functionality has to be implemented
-   *
-   * \throws UdpChannel::Error if called multiple times
    */
   void
   listen(const FaceCreatedCallback& onFaceCreated,
-         const FaceCreationFailedCallback& onReceiveFailed);
+         const FaceCreationFailedCallback& onFaceCreationFailed);
 
 private:
   void
@@ -106,29 +104,16 @@
                 const FaceCreationFailedCallback& onReceiveFailed);
 
   std::pair<bool, shared_ptr<Face>>
-  createFace(const udp::Endpoint& remoteEndpoint, ndn::nfd::FacePersistency persistency);
+  createFace(const udp::Endpoint& remoteEndpoint,
+             ndn::nfd::FacePersistency persistency);
 
 private:
+  const udp::Endpoint m_localEndpoint;
+  udp::Endpoint m_remoteEndpoint; ///< The latest peer that started communicating with us
+  boost::asio::ip::udp::socket m_socket; ///< Socket used to "accept" new peers
   std::map<udp::Endpoint, shared_ptr<Face>> m_channelFaces;
-
-  udp::Endpoint m_localEndpoint;
-
-  /**
-   * \brief The latest peer that started communicating with us
-   */
-  udp::Endpoint m_remoteEndpoint;
-
-  /**
-   * \brief Socket used to "accept" new communication
-   */
-  boost::asio::ip::udp::socket m_socket;
-
-  /**
-   * \brief When this timeout expires, all idle on-demand faces will be closed
-   */
-  time::seconds m_idleFaceTimeout;
-
   uint8_t m_inputBuffer[ndn::MAX_NDN_PACKET_SIZE];
+  time::seconds m_idleFaceTimeout; ///< Timeout for automatic closure of idle on-demand faces
 };
 
 } // namespace face
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 3cc1818..a544edf 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -310,8 +310,6 @@
 UdpFactory::createChannel(const udp::Endpoint& endpoint,
                           const time::seconds& timeout)
 {
-  NFD_LOG_DEBUG("Creating unicast channel " << endpoint);
-
   auto channel = findChannel(endpoint);
   if (channel)
     return channel;
@@ -331,7 +329,6 @@
   channel = std::make_shared<UdpChannel>(endpoint, timeout);
   m_channels[endpoint] = channel;
   prohibitEndpoint(endpoint);
-
   return channel;
 }
 
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index b253a70..87af308 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -43,6 +43,7 @@
   , m_size(0)
 {
   setUri(FaceUri(m_endpoint));
+  NFD_LOG_CHAN_INFO("Creating channel");
 }
 
 UnixStreamChannel::~UnixStreamChannel()
@@ -52,7 +53,7 @@
     // and ignore any errors
     boost::system::error_code error;
     m_acceptor.close(error);
-    NFD_LOG_DEBUG("[" << m_endpoint << "] Removing socket file");
+    NFD_LOG_CHAN_DEBUG("Removing socket file");
     boost::filesystem::remove(m_endpoint.path(), error);
   }
 }
@@ -63,7 +64,7 @@
                           int backlog/* = acceptor::max_connections*/)
 {
   if (isListening()) {
-    NFD_LOG_WARN("[" << m_endpoint << "] Already listening");
+    NFD_LOG_CHAN_WARN("Already listening");
     return;
   }
 
@@ -76,8 +77,7 @@
     boost::system::error_code error;
     boost::asio::local::stream_protocol::socket socket(getGlobalIoService());
     socket.connect(m_endpoint, error);
-    NFD_LOG_TRACE("[" << m_endpoint << "] connect() on existing socket file returned: "
-                  + error.message());
+    NFD_LOG_CHAN_TRACE("connect() on existing socket file returned: " << error.message());
     if (!error) {
       // someone answered, leave the socket alone
       BOOST_THROW_EXCEPTION(Error("Socket file at " + m_endpoint.path()
@@ -87,7 +87,7 @@
              error == boost::asio::error::timed_out) {
       // no one is listening on the remote side,
       // we can safely remove the stale socket
-      NFD_LOG_DEBUG("[" << m_endpoint << "] Removing stale socket file");
+      NFD_LOG_CHAN_DEBUG("Removing stale socket file");
       fs::remove(socketPath);
     }
   }
@@ -100,12 +100,11 @@
   m_acceptor.listen(backlog);
 
   if (::chmod(m_endpoint.path().c_str(), 0666) < 0) {
-    BOOST_THROW_EXCEPTION(Error("chmod(" + m_endpoint.path() + ") failed: " +
-                                std::strerror(errno)));
+    BOOST_THROW_EXCEPTION(Error("chmod(" + m_endpoint.path() + ") failed: " + std::strerror(errno)));
   }
 
-  // start accepting connections
   accept(onFaceCreated, onAcceptFailed);
+  NFD_LOG_CHAN_DEBUG("Started listening");
 }
 
 void
@@ -123,16 +122,15 @@
                                 const FaceCreationFailedCallback& onAcceptFailed)
 {
   if (error) {
-    if (error == boost::asio::error::operation_aborted) // when the socket is closed by someone
-      return;
-
-    NFD_LOG_DEBUG("[" << m_endpoint << "] Accept failed: " << error.message());
-    if (onAcceptFailed)
-      onAcceptFailed(500, "Accept failed: " + error.message());
+    if (error != boost::asio::error::operation_aborted) {
+      NFD_LOG_CHAN_DEBUG("Accept failed: " << error.message());
+      if (onAcceptFailed)
+        onAcceptFailed(500, "Accept failed: " + error.message());
+    }
     return;
   }
 
-  NFD_LOG_DEBUG("[" << m_endpoint << "] Incoming connection");
+  NFD_LOG_CHAN_TRACE("Incoming connection via fd " << m_socket.native_handle());
 
   auto linkService = make_unique<GenericLinkService>();
   auto transport = make_unique<UnixStreamTransport>(std::move(m_socket));
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
index 8f30db5..310030b 100644
--- a/daemon/face/unix-stream-channel.hpp
+++ b/daemon/face/unix-stream-channel.hpp
@@ -106,7 +106,7 @@
                const FaceCreationFailedCallback& onAcceptFailed);
 
 private:
-  unix_stream::Endpoint m_endpoint;
+  const unix_stream::Endpoint m_endpoint;
   boost::asio::local::stream_protocol::acceptor m_acceptor;
   boost::asio::local::stream_protocol::socket m_socket;
   size_t m_size;
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index 33a488f..a7aeadb 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.cpp
@@ -24,7 +24,6 @@
  */
 
 #include "unix-stream-factory.hpp"
-#include "core/logger.hpp"
 
 #include <boost/filesystem.hpp>
 
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index daf362c..02ae079 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -35,9 +35,10 @@
 
 WebSocketChannel::WebSocketChannel(const websocket::Endpoint& localEndpoint)
   : m_localEndpoint(localEndpoint)
-  , m_pingInterval(10000)
+  , m_pingInterval(time::seconds(10))
 {
   setUri(FaceUri(m_localEndpoint, "ws"));
+  NFD_LOG_CHAN_INFO("Creating channel");
 
   // Be quiet
   m_server.clear_access_channels(websocketpp::log::alevel::all);
@@ -81,7 +82,7 @@
     static_cast<WebSocketTransport*>(it->second->getTransport())->handlePongTimeout();
   }
   else {
-    NFD_LOG_WARN("Pong timeout on unknown transport");
+    NFD_LOG_CHAN_WARN("Pong timeout on unknown transport");
   }
 }
 
@@ -93,7 +94,7 @@
     static_cast<WebSocketTransport*>(it->second->getTransport())->handlePong();
   }
   else {
-    NFD_LOG_WARN("Pong received on unknown transport");
+    NFD_LOG_CHAN_WARN("Pong received on unknown transport");
   }
 }
 
@@ -106,17 +107,20 @@
     static_cast<WebSocketTransport*>(it->second->getTransport())->receiveMessage(msg->get_payload());
   }
   else {
-    NFD_LOG_WARN("Message received on unknown transport");
+    NFD_LOG_CHAN_WARN("Message received on unknown transport");
   }
 }
 
 void
 WebSocketChannel::handleOpen(websocketpp::connection_hdl hdl)
 {
+  NFD_LOG_CHAN_TRACE("Incoming connection from " << m_server.get_con_from_hdl(hdl)->get_remote_endpoint());
+
   auto linkService = make_unique<GenericLinkService>();
   auto transport = make_unique<WebSocketTransport>(hdl, ref(m_server), m_pingInterval);
   auto face = make_shared<Face>(std::move(linkService), std::move(transport));
 
+  BOOST_ASSERT(m_channelFaces.count(hdl) == 0);
   m_channelFaces[hdl] = face;
   connectFaceClosedSignal(*face, [this, hdl] { m_channelFaces.erase(hdl); });
 
@@ -131,21 +135,23 @@
     it->second->close();
   }
   else {
-    NFD_LOG_WARN("Close on unknown transport");
+    NFD_LOG_CHAN_WARN("Close on unknown transport");
   }
 }
 
 void
 WebSocketChannel::listen(const FaceCreatedCallback& onFaceCreated)
 {
-  if (m_server.is_listening()) {
-    NFD_LOG_WARN("[" << m_localEndpoint << "] Already listening");
+  if (isListening()) {
+    NFD_LOG_CHAN_WARN("Already listening");
     return;
   }
 
   m_onFaceCreatedCallback = onFaceCreated;
+
   m_server.listen(m_localEndpoint);
   m_server.start_accept();
+  NFD_LOG_CHAN_DEBUG("Started listening");
 }
 
 } // namespace face
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 7da5647..c1b2805 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -103,12 +103,10 @@
   handleClose(websocketpp::connection_hdl hdl);
 
 private:
-  websocket::Endpoint m_localEndpoint;
+  const websocket::Endpoint m_localEndpoint;
   websocket::Server m_server;
-
   std::map<websocketpp::connection_hdl, shared_ptr<Face>,
            std::owner_less<websocketpp::connection_hdl>> m_channelFaces;
-
   FaceCreatedCallback m_onFaceCreatedCallback;
   time::milliseconds m_pingInterval;
 };
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 3b813c0..a0b58e5 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.cpp
@@ -24,7 +24,6 @@
  */
 
 #include "websocket-factory.hpp"
-#include "core/logger.hpp"
 
 namespace nfd {
 namespace face {
