diff --git a/src/utility/nlsr_logger.cpp b/src/utility/nlsr_logger.cpp
index 804ef98..82b6e75 100644
--- a/src/utility/nlsr_logger.cpp
+++ b/src/utility/nlsr_logger.cpp
@@ -3,57 +3,57 @@
 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::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
+  NlsrLogger::getUserHomeDirectory()
+  {
+    string homeDirPath(getpwuid(getuid())->pw_dir);
+    if( homeDirPath.empty() )
     {
-        string homeDirPath(getpwuid(getuid())->pw_dir);
-        if( homeDirPath.empty() )
-        {
-            homeDirPath = getenv("HOME");
-        }
-        return homeDirPath;
+      homeDirPath = getenv("HOME");
     }
+    return homeDirPath;
+  }
 
-    void
-    NlsrLogger::initNlsrLogger(std::string dirPath)
+  void
+  NlsrLogger::initNlsrLogger(std::string dirPath)
+  {
+    string logDirPath(dirPath);
+    if( dirPath.empty() )
     {
-        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);
+      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 = 16 * 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 =  512 * 1024 * 1024,
+          keywords::min_free_space = 64 * 1024 * 1024
+        ));
+    sink->set_formatter(
+      expr::format("%1%: %2%")
+      % getEpochTime()
+      % expr::smessage
+    );
+    logging::core::get()->add_sink(sink);
+  }
 
 }//namespace nlsr
