diff --git a/daemon/core/logger.cpp b/daemon/core/logger.cpp
index 14dd380..928b112 100644
--- a/daemon/core/logger.cpp
+++ b/daemon/core/logger.cpp
@@ -7,14 +7,69 @@
  */
 
 #include "logger.hpp"
+#include <boost/algorithm/string.hpp>
 
-namespace nfd
+namespace nfd {
+
+inline static bool
+isNumber(const std::string& s)
 {
+  if (s.empty())
+    return false;
+
+  for (std::string::const_iterator i = s.begin(); i != s.end(); ++i)
+    {
+      if (!std::isdigit(*i))
+        return false;
+    }
+
+  return true;
+}
 
 Logger::Logger(const std::string& name)
-  : m_moduleName(name),
-    m_isEnabled(true)
+  : m_moduleName(name)
 {
+  char* nfdLog = getenv("NFD_LOG");
+  if (nfdLog)
+    {
+      std::string level = nfdLog;
+      if (isNumber(nfdLog))
+        {
+          setLogLevel(boost::lexical_cast<uint32_t>(nfdLog));
+        }
+      else if (boost::iequals(level, "none"))
+        {
+          m_enabledLogLevel = LOG_NONE;
+        }
+      else if (boost::iequals(level, "error"))
+        {
+          m_enabledLogLevel = LOG_ERROR;
+        }
+      else if (boost::iequals(level, "warn"))
+        {
+          m_enabledLogLevel = LOG_WARN;
+        }
+      else if (boost::iequals(level, "info"))
+        {
+          m_enabledLogLevel = LOG_INFO;
+        }
+      else if (boost::iequals(level, "debug"))
+        {
+          m_enabledLogLevel = LOG_DEBUG;
+        }
+      else if (boost::iequals(level, "trace"))
+        {
+          m_enabledLogLevel = LOG_TRACE;
+        }
+      else
+        {
+          m_enabledLogLevel = LOG_ALL;
+        }
+    }
+  else
+    {
+      m_enabledLogLevel = LOG_WARN;
+    }
 }
 
 std::ostream&
diff --git a/daemon/core/logger.hpp b/daemon/core/logger.hpp
index f8c6e8e..aad2394 100644
--- a/daemon/core/logger.hpp
+++ b/daemon/core/logger.hpp
@@ -18,22 +18,29 @@
   LOG_NONE           = 0, // no messages
   LOG_ERROR          = 1, // serious error messages
   LOG_WARN           = 2, // warning messages
-  LOG_TRACE          = 3, // trace messages
+  LOG_INFO           = 3, // informational messages
   LOG_DEBUG          = 4, // debug messages
-  LOG_INFO           = 5, // informational messages
-  LOG_FATAL          = 6, // fatal error messages
-  LOG_ALL            = 0x0fffffff, // all messages
+  LOG_TRACE          = 5, // trace messages (most verbose)
+  // LOG_FATAL is not a level and is logged unconditionally
+  LOG_ALL            = 255, // all messages
 };
 
 class Logger
 {
 public:
+  explicit
   Logger(const std::string& name);
   
   bool
   isEnabled(LogLevel level)
   {
-    return m_isEnabled;
+    return (m_enabledLogLevel >= level);
+  }
+
+  void
+  setLogLevel(uint32_t level)
+  {
+    m_enabledLogLevel = static_cast<LogLevel>(level);
   }
   
   const std::string&
@@ -44,7 +51,7 @@
   
 private:
   std::string m_moduleName;
-  bool m_isEnabled;
+  uint32_t    m_enabledLogLevel;
 };
 
 std::ostream&
@@ -93,8 +100,7 @@
        std::cerr<<"ERROR: "<<"["<<g_logger<<"] " << expression <<"\n"
   
 #define NFD_LOG_FATAL(expression)\
-    if(g_logger.isEnabled(nfd::LOG_FATAL)) \
-       std::cerr<<"FATAL: "<<"["<<g_logger<<"] " << expression <<"\n"
+    std::cerr<<"FATAL: "<<"["<<g_logger<<"] " << expression <<"\n"
   
 } //namespace nfd
 
diff --git a/tests/core/logger.cpp b/tests/core/logger.cpp
index ca55c37..6694ece 100644
--- a/tests/core/logger.cpp
+++ b/tests/core/logger.cpp
@@ -27,7 +27,7 @@
   {
     std::cerr.rdbuf(m_savedBuf);
   }
-  
+
   std::stringstream m_buffer;
   std::streambuf* m_savedBuf;
 };
@@ -35,14 +35,15 @@
 BOOST_FIXTURE_TEST_CASE(Basic, LoggerFixture)
 {
   NFD_LOG_INIT("BasicTests");
-  
+  g_logger.setLogLevel(LOG_ALL);
+
   NFD_LOG_TRACE("trace message JHGFDSR^1");
   NFD_LOG_DEBUG("debug message IGg2474fdksd fo " << 15 << 16 << 17);
   NFD_LOG_WARN("warning message XXXhdhd11" << 1 << "x");
-  NFD_LOG_INFO("info message Jjxjshj13"); 
+  NFD_LOG_INFO("info message Jjxjshj13");
   NFD_LOG_ERROR("error message !#$&^%$#@");
   NFD_LOG_FATAL("fatal message JJSjaamcng");
-  
+
   BOOST_CHECK_EQUAL(m_buffer.str(),
                     "TRACE: [BasicTests] trace message JHGFDSR^1\n"
                     "DEBUG: [BasicTests] debug message IGg2474fdksd fo 151617\n"
@@ -56,17 +57,22 @@
 class InClassLogger : public LoggerFixture
 {
 public:
+  InClassLogger()
+  {
+    g_logger.setLogLevel(LOG_ALL);
+  }
+
   void
   writeLogs()
   {
     NFD_LOG_TRACE("trace message JHGFDSR^1");
     NFD_LOG_DEBUG("debug message IGg2474fdksd fo " << 15 << 16 << 17);
     NFD_LOG_WARN("warning message XXXhdhd11" << 1 << "x");
-    NFD_LOG_INFO("info message Jjxjshj13"); 
+    NFD_LOG_INFO("info message Jjxjshj13");
     NFD_LOG_ERROR("error message !#$&^%$#@");
     NFD_LOG_FATAL("fatal message JJSjaamcng");
   }
-    
+
 private:
   NFD_LOG_INCLASS_DECLARE();
 };
@@ -76,7 +82,7 @@
 BOOST_FIXTURE_TEST_CASE(InClass, InClassLogger)
 {
   writeLogs();
-  
+
   BOOST_CHECK_EQUAL(m_buffer.str(),
                     "TRACE: [InClassLogger] trace message JHGFDSR^1\n"
                     "DEBUG: [InClassLogger] debug message IGg2474fdksd fo 151617\n"
@@ -92,17 +98,22 @@
 class InClassTemplateLogger : public LoggerFixture
 {
 public:
+  InClassTemplateLogger()
+  {
+    g_logger.setLogLevel(LOG_ALL);
+  }
+
   void
   writeLogs()
   {
     NFD_LOG_TRACE("trace message JHGFDSR^1");
     NFD_LOG_DEBUG("debug message IGg2474fdksd fo " << 15 << 16 << 17);
     NFD_LOG_WARN("warning message XXXhdhd11" << 1 << "x");
-    NFD_LOG_INFO("info message Jjxjshj13"); 
+    NFD_LOG_INFO("info message Jjxjshj13");
     NFD_LOG_ERROR("error message !#$&^%$#@");
     NFD_LOG_FATAL("fatal message JJSjaamcng");
   }
-    
+
 private:
   NFD_LOG_INCLASS_DECLARE();
 };
@@ -113,7 +124,7 @@
 BOOST_FIXTURE_TEST_CASE(GenericInTemplatedClass, InClassTemplateLogger<bool>)
 {
   writeLogs();
-  
+
   BOOST_CHECK_EQUAL(m_buffer.str(),
                     "TRACE: [GenericInClassTemplateLogger] trace message JHGFDSR^1\n"
                     "DEBUG: [GenericInClassTemplateLogger] debug message IGg2474fdksd fo 151617\n"
@@ -127,7 +138,7 @@
 BOOST_FIXTURE_TEST_CASE(SpecializedInTemplatedClass, InClassTemplateLogger<int>)
 {
   writeLogs();
-  
+
   BOOST_CHECK_EQUAL(m_buffer.str(),
                     "TRACE: [IntInClassLogger] trace message JHGFDSR^1\n"
                     "DEBUG: [IntInClassLogger] debug message IGg2474fdksd fo 151617\n"
