diff --git a/core/logger-factory.cpp b/core/logger-factory.cpp
deleted file mode 100644
index 3c419f1..0000000
--- a/core/logger-factory.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  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/>.
- */
-
-#include "logger-factory.hpp"
-
-#include <ndn-cxx/util/logging.hpp>
-
-#include <boost/algorithm/string/case_conv.hpp>
-#include <boost/range/adaptor/map.hpp>
-
-#ifdef HAVE_CUSTOM_LOGGER
-#error "This file should not be compiled when custom logger is used"
-#endif
-
-namespace nfd {
-
-NFD_LOG_INIT("LoggerFactory");
-
-LoggerFactory&
-LoggerFactory::getInstance()
-{
-  static LoggerFactory globalLoggerFactory;
-
-  return globalLoggerFactory;
-}
-
-LoggerFactory::LoggerFactory()
-  : m_defaultLevel(LOG_INFO)
-{
-  m_levelNames["NONE"] = LOG_NONE;
-  m_levelNames["ERROR"] = LOG_ERROR;
-  m_levelNames["WARN"] = LOG_WARN;
-  m_levelNames["INFO"] = LOG_INFO;
-  m_levelNames["DEBUG"] = LOG_DEBUG;
-  m_levelNames["TRACE"] = LOG_TRACE;
-  m_levelNames["ALL"] = LOG_ALL;
-
-  // Let ndn-cxx logging facility initialize Boost.Log backend,
-  // so that only one sink is attached to Boost.Log core.
-  ndn::util::Logging::setDestination(std::clog);
-}
-
-LoggerFactory::~LoggerFactory()
-{
-  ndn::util::Logging::flush();
-}
-
-void
-LoggerFactory::setConfigFile(ConfigFile& config)
-{
-  config.addSectionHandler("log", bind(&LoggerFactory::onConfig, this, _1, _2, _3));
-}
-
-LogLevel
-LoggerFactory::parseLevel(const std::string& level)
-{
-  std::string upperLevel = boost::to_upper_copy(level);
-
-  // std::cerr << "parsing level: " << upperLevel << std::endl;;
-  // std::cerr << "# levels: " << m_levelNames.size() << std::endl;
-  // std::cerr << m_levelNames.begin()->first << std::endl;
-
-  LevelMap::const_iterator levelIt = m_levelNames.find(upperLevel);
-  if (levelIt != m_levelNames.end()) {
-    return levelIt->second;
-  }
-  try {
-    uint32_t levelNo = boost::lexical_cast<uint32_t>(level);
-
-    if ((boost::lexical_cast<uint32_t>(LOG_NONE) <= levelNo &&
-         levelNo <= boost::lexical_cast<uint32_t>(LOG_TRACE)) ||
-        levelNo == LOG_ALL) {
-      return static_cast<LogLevel>(levelNo);
-    }
-  }
-  catch (const boost::bad_lexical_cast& error) {
-  }
-
-  BOOST_THROW_EXCEPTION(LoggerFactory::Error("Unsupported logging level \"" + level + "\""));
-}
-
-LogLevel
-LoggerFactory::extractLevel(const ConfigSection& item, const std::string& key)
-{
-  std::string levelString;
-  try {
-    levelString = item.get_value<std::string>();
-  }
-  catch (const boost::property_tree::ptree_error& error) {
-  }
-
-  if (levelString.empty()) {
-    BOOST_THROW_EXCEPTION(LoggerFactory::Error("No logging level found for option \"" + key + "\""));
-  }
-
-  return parseLevel(levelString);
-}
-
-void
-LoggerFactory::onConfig(const ConfigSection& section,
-                        bool isDryRun,
-                        const std::string& filename)
-{
-  // log
-  // {
-  //   ; default_level specifies the logging level for modules
-  //   ; that are not explicitly named. All debugging levels
-  //   ; listed above the selected value are enabled.
-  //
-  //   default_level INFO
-  //
-  //   ; You may also override the default for specific modules:
-  //
-  //   FibManager DEBUG
-  //   Forwarder WARN
-  // }
-
-  if (!isDryRun) {
-    ConfigSection::const_assoc_iterator item = section.find("default_level");
-    if (item != section.not_found()) {
-      LogLevel level = extractLevel(item->second, "default_level");
-      setDefaultLevel(level);
-    }
-    else {
-      setDefaultLevel(LOG_INFO);
-    }
-  }
-
-  for (const auto& i : section) {
-    LogLevel level = extractLevel(i.second, i.first);
-
-    if (i.first == "default_level") {
-      // do nothing
-    }
-    else {
-      std::unique_lock<std::mutex> lock(m_loggersGuard);
-      LoggerMap::iterator loggerIt = m_loggers.find(i.first);
-      if (loggerIt == m_loggers.end()) {
-        lock.unlock();
-        NFD_LOG_DEBUG("Failed to configure logging level for module \"" <<
-                      i.first << "\" (module not found)");
-      }
-      else if (!isDryRun) {
-        loggerIt->second.setLogLevel(level);
-        lock.unlock();
-        NFD_LOG_DEBUG("Changing level for module " << i.first << " to " << level);
-      }
-    }
-  }
-}
-
-void
-LoggerFactory::setDefaultLevel(LogLevel level)
-{
-  // std::cerr << "changing to default_level " << level << std::endl;
-  std::lock_guard<std::mutex> lock(m_loggersGuard);
-
-  m_defaultLevel = level;
-  for (auto&& logger : m_loggers) {
-    // std::cerr << "changing " << i->first << " to default " << m_defaultLevel << std::endl;
-    logger.second.setLogLevel(m_defaultLevel);
-  }
-}
-
-void
-LoggerFactory::flushBackend()
-{
-  ndn::util::Logging::flush();
-}
-
-Logger&
-LoggerFactory::create(const std::string& moduleName)
-{
-  return LoggerFactory::getInstance().createLogger(moduleName);
-}
-
-Logger&
-LoggerFactory::createLogger(const std::string& moduleName)
-{
-  // std::cerr << "creating logger for " << moduleName
-  //           << " with level " << m_defaultLevel << std::endl;
-
-  std::lock_guard<std::mutex> lock(m_loggersGuard);
-
-  std::pair<LoggerMap::iterator, bool> loggerIt =
-    m_loggers.insert(NameAndLogger(moduleName, Logger(moduleName, m_defaultLevel)));
-
-  return loggerIt.first->second;
-}
-
-std::list<std::string>
-LoggerFactory::getModules() const
-{
-  std::lock_guard<std::mutex> lock(m_loggersGuard);
-
-  std::list<std::string> modules;
-  for (const auto& loggerName : m_loggers | boost::adaptors::map_keys) {
-    modules.push_back(loggerName);
-  }
-
-  return modules;
-}
-
-} // namespace nfd
diff --git a/core/logger-factory.hpp b/core/logger-factory.hpp
deleted file mode 100644
index 5cafc64..0000000
--- a/core/logger-factory.hpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  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_CORE_LOGGER_FACTORY_HPP
-#define NFD_CORE_LOGGER_FACTORY_HPP
-
-#include "common.hpp"
-
-#ifdef HAVE_CUSTOM_LOGGER
-#include "custom-logger-factory.hpp"
-#else
-
-#include "config-file.hpp"
-#include "logger.hpp"
-
-#include <mutex>
-
-namespace nfd {
-
-class LoggerFactory : noncopyable
-{
-public:
-
-  class Error : public std::runtime_error
-  {
-  public:
-    explicit
-    Error(const std::string& error)
-      : std::runtime_error(error)
-    {
-    }
-  };
-
-  static LoggerFactory&
-  getInstance();
-
-  void
-  setConfigFile(ConfigFile& config);
-
-  void
-  onConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
-
-  std::list<std::string>
-  getModules() const;
-
-  static Logger&
-  create(const std::string& moduleName);
-
-
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
-
-  // these methods are used during unit-testing
-
-  LogLevel
-  getDefaultLevel() const;
-
-  void
-  setDefaultLevel(LogLevel level);
-
-  void
-  flushBackend();
-
-private:
-
-  LoggerFactory();
-
-  ~LoggerFactory();
-
-  Logger&
-  createLogger(const std::string& moduleName);
-
-  LogLevel
-  parseLevel(const std::string& level);
-
-  LogLevel
-  extractLevel(const ConfigSection& item, const std::string& key);
-
-private:
-
-  typedef std::map<std::string, LogLevel> LevelMap;
-  typedef std::pair<std::string, LogLevel> NameAndLevel;
-
-  LevelMap m_levelNames;
-
-  typedef std::map<std::string, Logger> LoggerMap;
-  typedef std::pair<std::string, Logger> NameAndLogger;
-
-  LoggerMap m_loggers;
-  mutable std::mutex m_loggersGuard;
-
-  LogLevel m_defaultLevel;
-};
-
-inline LogLevel
-LoggerFactory::getDefaultLevel() const
-{
-  return m_defaultLevel;
-}
-
-} // namespace nfd
-
-#endif // HAVE_CUSTOM_LOGGER
-
-#endif // NFD_CORE_LOGGER_FACTORY_HPP
diff --git a/core/logger.cpp b/core/logger.cpp
deleted file mode 100644
index 7803dfc..0000000
--- a/core/logger.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  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/>.
- */
-
-#include "logger.hpp"
-
-#ifdef HAVE_CUSTOM_LOGGER
-#error "This file should not be compiled when custom logger is used"
-#endif
-
-#include <ndn-cxx/util/time.hpp>
-#include <cinttypes>
-#include <stdio.h>
-#include <type_traits>
-
-namespace nfd {
-
-Logger::Logger(const std::string& name, LogLevel level)
-  : m_moduleName(name)
-  , m_enabledLogLevel(level)
-{
-}
-
-std::ostream&
-operator<<(std::ostream& os, const LoggerTimestamp&)
-{
-  using namespace ndn::time;
-
-  static const microseconds::rep ONE_SECOND = 1000000;
-  microseconds::rep microsecondsSinceEpoch = duration_cast<microseconds>(
-    system_clock::now().time_since_epoch()).count();
-
-  // 10 (whole seconds) + '.' + 6 (fraction) + '\0'
-  char buffer[10 + 1 + 6 + 1];
-  BOOST_ASSERT_MSG(microsecondsSinceEpoch / ONE_SECOND <= 9999999999L,
-                   "whole seconds cannot fit in 10 characters");
-
-  static_assert(std::is_same<microseconds::rep, int_least64_t>::value,
-                "PRIdLEAST64 is incompatible with microseconds::rep");
-  // - std::snprintf not found in some environments
-  //   http://redmine.named-data.net/issues/2299 for more information
-  snprintf(buffer, sizeof(buffer), "%" PRIdLEAST64 ".%06" PRIdLEAST64,
-           microsecondsSinceEpoch / ONE_SECOND,
-           microsecondsSinceEpoch % ONE_SECOND);
-
-  return os << buffer;
-}
-
-} // namespace nfd
diff --git a/core/logger.hpp b/core/logger.hpp
index 24ec63c..1cc0795 100644
--- a/core/logger.hpp
+++ b/core/logger.hpp
@@ -27,145 +27,37 @@
 #define NFD_CORE_LOGGER_HPP
 
 #include "common.hpp"
-
-#ifdef HAVE_CUSTOM_LOGGER
-#include "custom-logger.hpp"
-#else
-#include <boost/log/common.hpp>
-#include <boost/log/sources/logger.hpp>
+#include "ns3/log.h"
 
 namespace nfd {
 
-/** \brief indicates a log level
- *  \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- */
-enum LogLevel {
-  LOG_FATAL          = -1, // fatal (will be logged unconditionally)
-  LOG_NONE           = 0, // no messages
-  LOG_ERROR          = 1, // serious error messages
-  LOG_WARN           = 2, // warning messages
-  LOG_INFO           = 3, // informational messages
-  LOG_DEBUG          = 4, // debug messages
-  LOG_TRACE          = 5, // trace messages (most verbose)
-  LOG_ALL            = 255 // all messages
-};
-
-/** \brief provides logging for a module
- *  \note This type is internal. Logger should be accessed through NFD_LOG_* macros.
- *  \note This type is copyable because logger can be declared as a field of
- *        (usually template) classes, and shouldn't prevent those classes to be copyable.
- */
-class Logger
-{
-public:
-  Logger(const std::string& name, LogLevel level);
-
-  bool
-  isEnabled(LogLevel level) const
-  {
-    return m_enabledLogLevel >= level;
-  }
-
-  void
-  setLogLevel(LogLevel level)
-  {
-    m_enabledLogLevel = level;
-  }
-
-  const std::string&
-  getName() const
-  {
-    return m_moduleName;
-  }
-
-  void
-  setName(const std::string& name)
-  {
-    m_moduleName = name;
-  }
-
-public:
-  boost::log::sources::logger boostLogger;
-
-private:
-  std::string m_moduleName;
-  LogLevel    m_enabledLogLevel;
-};
-
-inline std::ostream&
-operator<<(std::ostream& output, const Logger& logger)
-{
-  output << logger.getName();
-  return output;
-}
-
-/**
- * \brief a tag that writes a timestamp upon stream output
- */
-struct LoggerTimestamp
-{
-};
-
-/**
- * \brief write a timestamp to \p os
- * \note This function is thread-safe.
- */
-std::ostream&
-operator<<(std::ostream& os, const LoggerTimestamp&);
-
-} // namespace nfd
-
-#include "core/logger-factory.hpp"
-
-namespace nfd {
-
-#define NFD_LOG_INIT(name) \
-static ::nfd::Logger& g_logger = ::nfd::LoggerFactory::create(name)
+#define NFD_LOG_INIT(name) NS_LOG_COMPONENT_DEFINE("nfd." name);
 
 #define NFD_LOG_INCLASS_DECLARE() \
-static ::nfd::Logger& g_logger
+static ns3::LogComponent g_log
 
 #define NFD_LOG_INCLASS_DEFINE(cls, name) \
-::nfd::Logger& cls::g_logger = ::nfd::LoggerFactory::create(name)
+ns3::LogComponent cls::g_log = ns3::LogComponent ("nfd." name, __FILE__)
 
 #define NFD_LOG_INCLASS_TEMPLATE_DEFINE(cls, name) \
 template<class T>                                  \
-::nfd::Logger& cls<T>::g_logger = ::nfd::LoggerFactory::create(name)
+ns3::LogComponent cls<T>::g_log = ns3::LogComponent ("nfd." name, __FILE__)
 
 #define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name) \
 template<>                                                                        \
-::nfd::Logger& cls<specialization>::g_logger = ::nfd::LoggerFactory::create(name)
+ns3::LogComponent cls<specialization>::g_log = ns3::LogComponent ("nfd." name, __FILE__)
 
 #define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name) \
 template<>                                                                 \
-::nfd::Logger& cls<s1, s2>::g_logger = ::nfd::LoggerFactory::create(name)
+s3::LogComponent cls<s1, s2>::g_log = ns3::LogComponent ("nfd." name, __FILE__)
 
-#if (BOOST_VERSION >= 105900) && (BOOST_VERSION < 106000)
-// workaround Boost bug 11549
-#define NFD_BOOST_LOG(x) BOOST_LOG(x) << ""
-#else
-#define NFD_BOOST_LOG(x) BOOST_LOG(x)
-#endif
-
-#define NFD_LOG_LINE(msg, expression) \
-::nfd::LoggerTimestamp{} << " "#msg": " << "[" << g_logger  << "] " << expression
-
-#define NFD_LOG(level, msg, expression)                                 \
-  do {                                                                  \
-    if (g_logger.isEnabled(::nfd::LOG_##level)) {                       \
-      NFD_BOOST_LOG(g_logger.boostLogger) << NFD_LOG_LINE(msg, expression); \
-    }                                                                   \
-  } while (false)
-
-#define NFD_LOG_TRACE(expression) NFD_LOG(TRACE, TRACE,   expression)
-#define NFD_LOG_DEBUG(expression) NFD_LOG(DEBUG, DEBUG,   expression)
-#define NFD_LOG_INFO(expression)  NFD_LOG(INFO,  INFO,    expression)
-#define NFD_LOG_WARN(expression)  NFD_LOG(WARN,  WARNING, expression)
-#define NFD_LOG_ERROR(expression) NFD_LOG(ERROR, ERROR,   expression)
-#define NFD_LOG_FATAL(expression) NFD_LOG(FATAL, FATAL,   expression)
+#define NFD_LOG_TRACE(expression) NS_LOG_LOGIC(expression)
+#define NFD_LOG_DEBUG(expression) NS_LOG_DEBUG(expression)
+#define NFD_LOG_INFO(expression) NS_LOG_INFO(expression)
+#define NFD_LOG_ERROR(expression) NS_LOG_ERROR(expression)
+#define NFD_LOG_WARN(expression) NS_LOG_WARN(expression)
+#define NFD_LOG_FATAL(expression) NS_LOG_FATAL(expression)
 
 } // namespace nfd
 
-#endif // HAVE_CUSTOM_LOGGER
-
 #endif // NFD_CORE_LOGGER_HPP
