diff --git a/core/logger-factory.cpp b/core/logger-factory.cpp
deleted file mode 100644
index a463b94..0000000
--- a/core/logger-factory.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  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 <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;
-}
-
-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 = level;
-  boost::to_upper(upperLevel);
-
-  // 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);
-  }
-}
-
-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 606ac1c..0000000
--- a/core/logger-factory.hpp
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  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"
-
-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);
-
-private:
-
-  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 3a9da61..0000000
--- a/core/logger.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015,  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 {
-
-std::mutex g_logMutex;
-
-Logger::Logger(const std::string& name, LogLevel level)
-  : m_moduleName(name)
-  , m_enabledLogLevel(level)
-{
-}
-
-const char*
-Logger::now()
-{
-  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'
-  static 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);
-
-  // It's okay to return a statically allocated buffer, because Logger::now() is invoked
-  // only once per log macro.
-  return buffer;
-}
-
-} // namespace nfd
diff --git a/core/logger.hpp b/core/logger.hpp
index 54af7cb..7c10461 100644
--- a/core/logger.hpp
+++ b/core/logger.hpp
@@ -26,130 +26,19 @@
 #ifndef NFD_CORE_LOGGER_HPP
 #define NFD_CORE_LOGGER_HPP
 
-#include "common.hpp"
-
-#ifdef HAVE_CUSTOM_LOGGER
-#include "custom-logger.hpp"
-#else
-
-#include <mutex>
+#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
-};
+#define NFD_LOG_INIT(name) NS_LOG_COMPONENT_DEFINE("nfd." name);
 
-/** \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;
-  }
-
-  /** \return string representation of time since epoch: seconds.microseconds
-   *  \warning Return value is in a statically allocated buffer,
-   *           which subsequent calls will overwrite.
-   */
-  static const char*
-  now();
-
-private:
-  std::string m_moduleName;
-  LogLevel    m_enabledLogLevel;
-};
-
-inline std::ostream&
-operator<<(std::ostream& output, const Logger& logger)
-{
-  output << logger.getName();
-  return output;
-}
+#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
 
-#include "core/logger-factory.hpp"
-
-namespace nfd {
-
-#define NFD_LOG_INIT(name) \
-static nfd::Logger& g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_DECLARE() \
-static nfd::Logger& g_logger
-
-#define NFD_LOG_INCLASS_DEFINE(cls, name) \
-nfd::Logger& cls::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_DEFINE(cls, name) \
-template<class T>                                  \
-nfd::Logger& cls<T>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_TEMPLATE_SPECIALIZATION_DEFINE(cls, specialization, name) \
-template<>                                                                        \
-nfd::Logger& cls<specialization>::g_logger = nfd::LoggerFactory::create(name)
-
-#define NFD_LOG_INCLASS_2TEMPLATE_SPECIALIZATION_DEFINE(cls, s1, s2, name) \
-template<>                                                                 \
-nfd::Logger& cls<s1, s2>::g_logger = nfd::LoggerFactory::create(name)
-
-extern std::mutex g_logMutex;
-
-#define NFD_LOG(level, msg, expression)                          \
-do {                                                             \
-  if (g_logger.isEnabled(::nfd::LOG_##level)) {                  \
-    std::lock_guard<std::mutex> lock(::nfd::g_logMutex);         \
-    std::clog << ::nfd::Logger::now() << " "#msg": "             \
-              << "[" << g_logger << "] " << expression << "\n";  \
-  }                                                              \
-} 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)
-
-} // namespace nfd
-
-#endif // HAVE_CUSTOM_LOGGER
-
 #endif // NFD_CORE_LOGGER_HPP
