diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
index 92a02e8..f669a93 100644
--- a/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
+++ b/app/src/main/jni/ndn-cxx-android/ndn-cxx-config.hpp
@@ -1,16 +1,17 @@
 #ifndef W_SRC_NDN_CXX_CONFIG_HPP_WAF
 #define W_SRC_NDN_CXX_CONFIG_HPP_WAF
 
+#define NDN_CXX_HAVE_STD_TO_STRING 1
+#define NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR 1
 #define NDN_CXX_HAVE_IS_DEFAULT_CONSTRUCTIBLE 1
 #define NDN_CXX_HAVE_IS_NOTHROW_MOVE_CONSTRUCTIBLE 1
 #define NDN_CXX_HAVE_IS_NOTHROW_MOVE_ASSIGNABLE 1
-#define NDN_CXX_HAVE_CXX_FRIEND_TYPENAME 1
-#define NDN_CXX_HAVE_CXX_OVERRIDE_FINAL 1
-#define NDN_CXX_NDN_CXX_HAVE_VECTOR_INSERT_ERASE_CONST_ITERATOR 1
-#define NDN_CXX_HAVE_PTHREAD 1
 #define NDN_CXX_HAVE_RT
+#define NDN_CXX_HAVE_PTHREAD 1
 #define NDN_CXX_HAVE_SQLITE3 1
-#define NDN_CXX_HAVE_CRYPTOPP_CONFIG_H 1
 #define NDN_CXX_SYSCONFDIR "./etc"
+#define NDN_CXX_NDEBUG 1
+#define NDEBUG 1
+#define HAVE_NDN_CXX_CUSTOM_LOGGER 1
 
 #endif /* W_SRC_NDN_CXX_CONFIG_HPP_WAF */
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
new file mode 100644
index 0000000..41cae15
--- /dev/null
+++ b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.cpp
@@ -0,0 +1,88 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "ndn-cxx-custom-logger.hpp"
+#include "ndn-cxx-custom-logging.hpp"
+
+#include <cinttypes>
+#include <stdio.h>
+#include <type_traits>
+
+namespace ndn {
+namespace util {
+
+std::ostream&
+operator<<(std::ostream& os, LogLevel level)
+{
+  switch (level) {
+  case LogLevel::FATAL:
+    return os << "FATAL";
+  case LogLevel::NONE:
+    return os << "NONE";
+  case LogLevel::ERROR:
+    return os << "ERROR";
+  case LogLevel::WARN:
+    return os << "WARN";
+  case LogLevel::INFO:
+    return os << "INFO";
+  case LogLevel::DEBUG:
+    return os << "DEBUG";
+  case LogLevel::TRACE:
+    return os << "TRACE";
+  case LogLevel::ALL:
+    return os << "ALL";
+  }
+
+  BOOST_THROW_EXCEPTION(std::invalid_argument("unknown log level " + to_string(static_cast<int>(level))));
+}
+
+LogLevel
+parseLogLevel(const std::string& s)
+{
+  if (s == "FATAL")
+    return LogLevel::FATAL;
+  else if (s == "NONE")
+    return LogLevel::NONE;
+  else if (s == "ERROR")
+    return LogLevel::ERROR;
+  else if (s == "WARN")
+    return LogLevel::WARN;
+  else if (s == "INFO")
+    return LogLevel::INFO;
+  else if (s == "DEBUG")
+    return LogLevel::DEBUG;
+  else if (s == "TRACE")
+    return LogLevel::TRACE;
+  else if (s == "ALL")
+    return LogLevel::ALL;
+
+  BOOST_THROW_EXCEPTION(std::invalid_argument("unrecognized log level '" + s + "'"));
+}
+
+Logger::Logger(const std::string& name)
+  : m_moduleName(name)
+{
+  this->setLevel(LogLevel::NONE);
+  Logging::addLogger(*this);
+}
+
+} // namespace util
+} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
new file mode 100644
index 0000000..892c1d5
--- /dev/null
+++ b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logger.hpp
@@ -0,0 +1,121 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
+#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
+
+#include "common.hpp"
+#include <atomic>
+#include <android/log.h>
+
+namespace ndn {
+namespace util {
+
+/** \brief indicates the severity level of a log message
+ */
+enum class LogLevel {
+  FATAL   = -1,   ///< fatal (will be logged unconditionally)
+  NONE    = 0,    ///< no messages
+  ERROR   = 1,    ///< serious error messages
+  WARN    = 2,    ///< warning messages
+  INFO    = 3,    ///< informational messages
+  DEBUG   = 4,    ///< debug messages
+  TRACE   = 5,    ///< trace messages (most verbose)
+  ALL     = 255   ///< all messages
+};
+
+/** \brief output LogLevel as string
+ *  \throw std::invalid_argument unknown \p level
+ */
+std::ostream&
+operator<<(std::ostream& os, LogLevel level);
+
+/** \brief parse LogLevel from string
+ *  \throw std::invalid_argument unknown level name
+ */
+LogLevel
+parseLogLevel(const std::string& s);
+
+/** \brief represents a logger in logging facility
+ *  \note User should declare a new logger with \p NDN_LOG_INIT macro.
+ */
+class Logger
+{
+public:
+  explicit
+  Logger(const std::string& name);
+
+  const std::string&
+  getModuleName() const
+  {
+    return m_moduleName;
+  }
+
+  bool
+  isLevelEnabled(LogLevel level) const
+  {
+    return m_currentLevel.load(std::memory_order_relaxed) >= level;
+  }
+
+  void
+  setLevel(LogLevel level)
+  {
+    m_currentLevel.store(level, std::memory_order_relaxed);
+  }
+
+private:
+  const std::string m_moduleName;
+  std::atomic<LogLevel> m_currentLevel;
+};
+
+/** \brief declare a log module
+ */
+#define NDN_LOG_INIT(name) \
+  namespace { \
+    inline ::ndn::util::Logger& getNdnCxxLogger() \
+    { \
+      static ::ndn::util::Logger logger(BOOST_STRINGIZE(name)); \
+      return logger; \
+    } \
+  } \
+  struct ndn_cxx__allow_trailing_semicolon
+
+#define NDN_LOG(level, androidLevel, msg, expression)   \
+  do { \
+      if (getNdnCxxLogger().isLevelEnabled(::ndn::util::LogLevel::level)) {           \
+      std::ostringstream os;                                              \
+      os << expression;                                                   \
+      __android_log_print(ANDROID_LOG_##androidLevel,                     \
+                          getNdnCxxLogger().getModuleName().c_str(), "%s", os.str().c_str()); \
+    }                                                                     \
+  } while (false)
+
+#define NDN_LOG_TRACE(expression) NDN_LOG(TRACE, VERBOSE, TRACE, expression)
+#define NDN_LOG_DEBUG(expression) NDN_LOG(DEBUG, DEBUG, DEBUG,   expression)
+#define NDN_LOG_INFO(expression)  NDN_LOG(INFO,  INFO,  INFO,    expression)
+#define NDN_LOG_WARN(expression)  NDN_LOG(WARN,  WARN,  WARNING, expression)
+#define NDN_LOG_ERROR(expression) NDN_LOG(ERROR, ERROR, ERROR,   expression)
+#define NDN_LOG_FATAL(expression) NDN_LOG(FATAL, FATAL, FATAL,   expression)
+
+} // namespace util
+} // namespace ndn
+
+#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGER_HPP
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
new file mode 100644
index 0000000..845d412
--- /dev/null
+++ b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.cpp
@@ -0,0 +1,109 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "ndn-cxx-custom-logging.hpp"
+#include "ndn-cxx-custom-logger.hpp"
+
+#include <cstdlib>
+#include <sstream>
+
+namespace ndn {
+namespace util {
+
+static const LogLevel INITIAL_DEFAULT_LEVEL = LogLevel::NONE;
+
+Logging&
+Logging::get()
+{
+  // Initialization of block-scope variables with static storage duration is thread-safe.
+  // See ISO C++ standard [stmt.dcl]/4
+  static Logging instance;
+  return instance;
+}
+
+Logging::Logging()
+{
+}
+
+void
+Logging::addLoggerImpl(Logger& logger)
+{
+  std::lock_guard<std::mutex> lock(m_mutex);
+
+  const std::string& moduleName = logger.getModuleName();
+  m_loggers.insert({moduleName, &logger});
+
+  auto levelIt = m_enabledLevel.find(moduleName);
+  if (levelIt == m_enabledLevel.end()) {
+    levelIt = m_enabledLevel.find("*");
+  }
+  LogLevel level = levelIt == m_enabledLevel.end() ? INITIAL_DEFAULT_LEVEL : levelIt->second;
+  logger.setLevel(level);
+}
+
+void
+Logging::setLevelImpl(const std::string& moduleName, LogLevel level)
+{
+  std::lock_guard<std::mutex> lock(m_mutex);
+
+  if (moduleName == "*") {
+    this->setDefaultLevel(level);
+    return;
+  }
+
+  m_enabledLevel[moduleName] = level;
+  auto range = m_loggers.equal_range(moduleName);
+  for (auto i = range.first; i != range.second; ++i) {
+    i->second->setLevel(level);
+  }
+}
+
+void
+Logging::setDefaultLevel(LogLevel level)
+{
+  m_enabledLevel.clear();
+  m_enabledLevel["*"] = level;
+
+  for (auto i = m_loggers.begin(); i != m_loggers.end(); ++i) {
+    i->second->setLevel(level);
+  }
+}
+
+void
+Logging::setLevelImpl(const std::string& config)
+{
+  std::stringstream ss(config);
+  std::string configModule;
+  while (std::getline(ss, configModule, ':')) {
+    size_t ind = configModule.find('=');
+    if (ind == std::string::npos) {
+      BOOST_THROW_EXCEPTION(std::invalid_argument("malformed logging config: '=' is missing"));
+    }
+
+    std::string moduleName = configModule.substr(0, ind);
+    LogLevel level = parseLogLevel(configModule.substr(ind+1));
+
+    this->setLevelImpl(moduleName, level);
+  }
+}
+
+} // namespace util
+} // namespace ndn
diff --git a/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
new file mode 100644
index 0000000..b59b927
--- /dev/null
+++ b/app/src/main/jni/ndn-cxx-android/ndn-cxx-custom-logging.hpp
@@ -0,0 +1,126 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2016 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
+#define NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
+
+#include "common.hpp"
+
+#include <mutex>
+#include <unordered_map>
+
+namespace ndn {
+namespace util {
+
+enum class LogLevel;
+class Logger;
+
+/** \brief controls the logging facility
+ *
+ *  \note Public static methods are thread safe.
+ *        Non-public methods are not guaranteed to be thread safe.
+ */
+class Logging : noncopyable
+{
+public:
+  /** \brief register a new logger
+   *  \note App should declare a new logger with \p NDN_LOG_INIT macro.
+   */
+  static void
+  addLogger(Logger& logger);
+
+  /** \brief set severity level
+   *  \param moduleName logger name, or "*" for default level
+   *  \param level minimum severity level
+   *
+   *  Log messages are output only if its severity is greater than the set minimum severity level.
+   *  Initial default severity level is \p LogLevel::NONE which enables FATAL only.
+   *
+   *  Changing the default level overwrites individual settings.
+   */
+  static void
+  setLevel(const std::string& moduleName, LogLevel level);
+
+  /** \brief set severity levels with a config string
+   *  \param config colon-separate key=value pairs
+   *  \throw std::invalid_argument config string is malformed
+   *
+   *  \code
+   *  Logging::setSeverityLevels("*=INFO:Face=DEBUG:NfdController=WARN");
+   *  \endcode
+   *  is equivalent to
+   *  \code
+   *  Logging::setSeverityLevel("*", LogLevel::INFO);
+   *  Logging::setSeverityLevel("Face", LogLevel::DEBUG);
+   *  Logging::setSeverityLevel("NfdController", LogLevel::WARN);
+   *  \endcode
+   */
+  static void
+  setLevel(const std::string& config);
+
+private:
+  Logging();
+
+  void
+  addLoggerImpl(Logger& logger);
+
+  void
+  setLevelImpl(const std::string& moduleName, LogLevel level);
+
+  void
+  setDefaultLevel(LogLevel level);
+
+  void
+  setLevelImpl(const std::string& config);
+
+NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+  static Logging&
+  get();
+
+private:
+  std::mutex m_mutex;
+  std::unordered_map<std::string, LogLevel> m_enabledLevel; ///< moduleName => minimum level
+  std::unordered_multimap<std::string, Logger*> m_loggers; ///< moduleName => logger
+};
+
+inline void
+Logging::addLogger(Logger& logger)
+{
+  get().addLoggerImpl(logger);
+}
+
+inline void
+Logging::setLevel(const std::string& moduleName, LogLevel level)
+{
+  get().setLevelImpl(moduleName, level);
+}
+
+inline void
+Logging::setLevel(const std::string& config)
+{
+  get().setLevelImpl(config);
+}
+
+
+} // namespace util
+} // namespace ndn
+
+#endif // NFD_ANDROID_NDN_CXX_ANDROID_NDN_CXX_CUSTOM_LOGGING_HPP
