diff --git a/src/utility/nlsr_logger.cpp b/src/utility/nlsr_logger.cpp
new file mode 100644
index 0000000..804ef98
--- /dev/null
+++ b/src/utility/nlsr_logger.cpp
@@ -0,0 +1,59 @@
+#include "nlsr_logger.hpp"
+
+namespace nlsr
+{
+
+    string
+    NlsrLogger::getEpochTime()
+    {
+        std::stringstream ss;
+        boost::posix_time::ptime time_t_epoch(boost::gregorian::date(1970,1,1));
+        boost::posix_time::ptime now = boost::posix_time::microsec_clock::local_time();
+        boost::posix_time::time_duration diff = now - time_t_epoch;
+        ss<<diff.total_seconds()<<"."<<boost::format("%06i")%(diff.total_microseconds()
+                %1000000);
+        return ss.str();
+    }
+
+    string
+    NlsrLogger::getUserHomeDirectory()
+    {
+        string homeDirPath(getpwuid(getuid())->pw_dir);
+        if( homeDirPath.empty() )
+        {
+            homeDirPath = getenv("HOME");
+        }
+        return homeDirPath;
+    }
+
+    void
+    NlsrLogger::initNlsrLogger(std::string dirPath)
+    {
+        string logDirPath(dirPath);
+        if( dirPath.empty() )
+        {
+            logDirPath=getUserHomeDirectory()+"/nlsrLog";
+        }
+        cout<<"Log Dir Path: "<< logDirPath<<endl;
+        typedef sinks::synchronous_sink< sinks::text_file_backend > file_sink;
+        shared_ptr< file_sink > sink(new file_sink(
+                                         keywords::file_name = logDirPath
+                                                 +"/NLSR%Y%m%d%H%M%S_%3N.log",
+                                         keywords::rotation_size = 128 * 1024 * 1024,
+                                         keywords::time_based_rotation = sinks::file::rotation_at_time_point(12, 0, 0),
+                                         keywords::auto_flush = true
+                                     ));
+        sink->locked_backend()->set_file_collector(sinks::file::make_collector(
+                    keywords::target = logDirPath,
+                    keywords::max_size = 16 * 1024 * 1024 * 1024,
+                    keywords::min_free_space = 128 * 1024 * 1024
+                ));
+        sink->set_formatter(
+            expr::format("%1%: %2%")
+            % getEpochTime()
+            % expr::smessage
+        );
+        logging::core::get()->add_sink(sink);
+    }
+
+}//namespace nlsr
diff --git a/src/utility/nlsr_logger.hpp b/src/utility/nlsr_logger.hpp
new file mode 100644
index 0000000..222ac52
--- /dev/null
+++ b/src/utility/nlsr_logger.hpp
@@ -0,0 +1,62 @@
+#ifndef NLSR_LOGGER_HPP
+#define NLSR_LOGGER_HPP
+
+#define BOOST_LOG_DYN_LINK 1
+
+#include <stdexcept>
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <pwd.h>
+#include <cstdlib>
+#include <string>
+#include <unistd.h>
+#include <boost/format.hpp>
+#include <boost/smart_ptr/shared_ptr.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/date_time/local_time/local_time.hpp>
+#include <boost/log/common.hpp>
+#include <boost/log/expressions.hpp>
+#include <boost/log/attributes.hpp>
+#include <boost/log/sources/logger.hpp>
+#include <boost/log/sinks/sync_frontend.hpp>
+#include <boost/log/sinks/text_file_backend.hpp>
+
+namespace nlsr
+{
+
+    namespace logging = boost::log;
+    namespace attrs = boost::log::attributes;
+    namespace src = boost::log::sources;
+    namespace sinks = boost::log::sinks;
+    namespace expr = boost::log::expressions;
+    namespace keywords = boost::log::keywords;
+
+    using boost::shared_ptr;
+    using namespace std;
+
+
+    class NlsrLogger
+    {
+    public:
+        NlsrLogger()
+        {
+        }
+
+        void initNlsrLogger(std::string dirPath);
+
+        src::logger& getLogger()
+        {
+            return mLogger;
+        }
+
+    private:
+        string getEpochTime();
+        string getUserHomeDirectory();
+
+    private:
+        src::logger mLogger;
+    };
+
+}//namespace nlsr
+#endif
diff --git a/src/utility/nlsr_tokenizer.cpp b/src/utility/nlsr_tokenizer.cpp
new file mode 100644
index 0000000..809e395
--- /dev/null
+++ b/src/utility/nlsr_tokenizer.cpp
@@ -0,0 +1,110 @@
+#include <iostream>
+#include <boost/tokenizer.hpp>
+#include <boost/algorithm/string.hpp>
+#include <string>
+#include <algorithm>
+
+#include "nlsr_tokenizer.hpp"
+
+namespace nlsr
+{
+
+    using namespace std;
+    using namespace boost;
+
+    void
+    nlsrTokenizer::makeToken()
+    {
+        char_separator<char> sep(seps.c_str());
+        tokenizer< char_separator<char> >tokens(originalString, sep);
+        tokenizer< char_separator<char> >::iterator tok_iter = tokens.begin();
+        for ( ; tok_iter != tokens.end(); ++tok_iter)
+        {
+            string oneToken(*tok_iter);
+            trim(oneToken);
+            if(!oneToken.empty())
+            {
+                insertToken(oneToken);
+            }
+        }
+        firstToken=vTokenList[0];
+        makeRestOfTheLine();
+    }
+
+    void
+    nlsrTokenizer::insertToken(const string& token)
+    {
+        tokenList.push_back(token);
+        vTokenList.push_back(token);
+    }
+
+    int
+    nlsrTokenizer::getTokenPosition(string& token)
+    {
+        int pos=-1;
+        int i=0;
+        for(std::list<string>::iterator it=tokenList.begin();
+                it!=tokenList.end(); it++)
+        {
+            if( (*it) == token )
+            {
+                break;
+            }
+            i++;
+        }
+        if( i < tokenList.size() )
+        {
+            pos=i;
+        }
+        return pos;
+    }
+
+    string
+    nlsrTokenizer::getTokenString(int from , int to)
+    {
+        string returnString="";
+        if((from>=0 && to<tokenList.size()) &&
+                (to>=from && to <tokenList.size()))
+        {
+            for(int i=from; i<=to; i++)
+            {
+                returnString+=seps;
+                returnString+=vTokenList[i];
+            }
+        }
+        trim(returnString);
+        return returnString;
+    }
+
+    string
+    nlsrTokenizer::getTokenString(int from)
+    {
+        return getTokenString(from,tokenList.size()-1);
+    }
+
+    static bool
+    tokenCompare(string& s1, string& s2)
+    {
+        return s1==s2;
+    }
+
+    void
+    nlsrTokenizer::makeRestOfTheLine()
+    {
+        restOfTheLine=getTokenString(1);
+    }
+
+    bool
+    nlsrTokenizer::doesTokenExist(string token)
+    {
+        std::list<string >::iterator it = std::find_if( tokenList.begin(),
+                                          tokenList.end(),
+                                          bind(&tokenCompare, _1 , token));
+        if( it != tokenList.end() )
+        {
+            return true;
+        }
+        return false;
+    }
+
+}//namespace nlsr
diff --git a/src/utility/nlsr_tokenizer.hpp b/src/utility/nlsr_tokenizer.hpp
new file mode 100644
index 0000000..6cd97e0
--- /dev/null
+++ b/src/utility/nlsr_tokenizer.hpp
@@ -0,0 +1,104 @@
+#ifndef NLSR_TOKENIZER_HPP
+#define NLSR_TOKENIZER_HPP
+
+#include <iostream>
+#include <boost/tokenizer.hpp>
+#include <boost/algorithm/string.hpp>
+#include <string>
+#include <list>
+#include <vector>
+#include <ndn-cpp-dev/face.hpp>
+
+namespace nlsr
+{
+
+    using namespace std;
+    using namespace boost;
+
+    class nlsrTokenizer
+    {
+    public:
+        nlsrTokenizer(const string& inputString)
+            : firstToken()
+            , restOfTheLine()
+            , currentPosition(0)
+        {
+            seps = " ";
+            originalString = inputString;
+            makeToken();
+        }
+
+        nlsrTokenizer(const string& inputString, const string& separator)
+            : firstToken()
+            , restOfTheLine()
+            , currentPosition(0)
+        {
+            seps = separator;
+            originalString = inputString;
+            makeToken();
+        }
+
+        string getFirstToken()
+        {
+            return firstToken;
+        }
+
+        string getRestOfLine()
+        {
+            return restOfTheLine;
+        }
+
+        void resetCurrentPosition(uint32_t cp=0)
+        {
+            if( cp >=0 && cp <= vTokenList.size() )
+            {
+                currentPosition=cp;
+            }
+        }
+
+        string getNextToken()
+        {
+            if(currentPosition >= 0 && currentPosition <= (vTokenList.size()-1))
+            {
+                return vTokenList[currentPosition++];
+            }
+            return "";
+        }
+
+        uint32_t getTokenNumber()
+        {
+            return tokenList.size();
+        }
+
+        string getToken(int position)
+        {
+            if( position >=0 && position <vTokenList.size() )
+            {
+                return vTokenList[position];
+            }
+            return "";
+        }
+
+        int getTokenPosition(string& token);
+        string getTokenString(int from , int to);
+        string getTokenString(int from);
+        bool doesTokenExist(string token);
+
+
+    private:
+
+        void makeToken();
+        void insertToken(const string& token);
+        void makeRestOfTheLine();
+
+        string seps;
+        string originalString;
+        string firstToken;
+        string restOfTheLine;
+        std::list<string> tokenList;
+        std::vector<string> vTokenList;
+        uint32_t currentPosition;
+    };
+
+}//namespace nlsr
+#endif
