Use ndn-cxx logging facility
refs: #3949
Change-Id: I5d0931c3576c88e0c2fa52bdd0a716946400e0bc
diff --git a/docs/GETTING-STARTED.rst b/docs/GETTING-STARTED.rst
index 0dbfafd..f2bd2d9 100644
--- a/docs/GETTING-STARTED.rst
+++ b/docs/GETTING-STARTED.rst
@@ -53,8 +53,26 @@
nlsr -f /usr/local/etc/ndn/nlsr.conf
-To run NLSR as daemon, use the ``-d`` flag:
+Logging
+-------
+
+NLSR uses the ndn-cxx logging facility. All levels listed below the selected log-level
+value are enabled.
::
- nlsr -d
+ Valid values:
+
+ TRACE trace messages (most verbose)
+ DEBUG debugging messages
+ INFO informational messages
+ WARN warning messages
+ ERROR error messages
+ FATAL fatal (will be logged unconditionally)
+
+To obtain logs for NLSR, set the NDN_LOG environment variable with the correct prefix and
+log-level settings. For example, running the command `export NDN_LOG=nlsr.*=TRACE && nlsr`
+will display all log messages in NLSR with a DEBUG level or below. If the user is presented
+with an error message `User does not have read and write permission on the directory` it can
+be circumvented by running the application with sudo: `sudo env NDN_LOG=nlsr.*=DEBUG nlsr`.
+Use `man ndn-log` for more detailed instructions.
diff --git a/docs/INSTALL.rst b/docs/INSTALL.rst
index f54163a..947d067 100644
--- a/docs/INSTALL.rst
+++ b/docs/INSTALL.rst
@@ -18,20 +18,6 @@
https://github.com/named-data/ChronoSync#build
-- log4cxx library
-
- On Ubuntu Linux:
-
- ::
-
- sudo apt-get install liblog4cxx10-dev
-
- On OS X with MacPorts:
-
- ::
-
- sudo port install log4cxx
-
Build
-----
diff --git a/docs/ROUTER-CONFIG.rst b/docs/ROUTER-CONFIG.rst
index fd08cb6..277d7a3 100644
--- a/docs/ROUTER-CONFIG.rst
+++ b/docs/ROUTER-CONFIG.rst
@@ -83,11 +83,7 @@
; InterestLifetime (in seconds) for LSA fetching
lsa-interest-lifetime 4 ; default value 4. Valid values 1-60
- ; log-level is to set the levels of log for NLSR
- log-level INFO ; default value INFO, valid value DEBUG, INFO
- log-dir /var/log/nlsr/
seq-dir /var/lib/nlsr/
- ; log4cxx-conf /path/to/log4cxx-conf
}
; the neighbors section contains the configuration for router's neighbors and hello's behavior
@@ -183,28 +179,17 @@
prefix /ndn/news/memphis/politics/lutherking
}
-
-NLSR will have the following error if ``log-dir`` does not exist:
-
-::
-
- Provided log directory </var/log/nlsr/> does not exist
- Error in configuration file processing! Exiting from NLSR
-
-By default ``/var/log/nlsr/`` is set to be NLSR's log directory and ``/var/lib/nlsr/`` is set to be
-NLSR's sequence file directory. They do not exist and will need to be created.
-Also, since these are system directories it will require the user to run NLSR as root.
-If one does not have permission to write to the specified directory,
-then NLSR will produce the following error:
+By default NLSR's sequence file directory is set to ``/var/lib/nlsr/``. User must create this
+directory before starting NLSR. Since this is a system directory, NLSR must either be executed
+as root, or NLSR can be run as user "nlsr" after configuring the filesystem to grant "nlsr"
+read and write permissions. If user lacks permissions, the following error will occur:
::
User does not have read and write permission on the directory
Error in configuration file processing! Exiting from NLSR
-To avoid this, the directories can be set in a user owned directory.
-The directories for log and sequence file can be same.
-For example:
+To avoid this, the directory can be set in a user-owned directory. For example:
::
@@ -212,7 +197,6 @@
{
...
- log-dir /home/username/nlsr/log ; path for log directory (Absolute path)
seq-dir /home/username/nlsr/log ; path for sequence directory (Absolute path)
}
diff --git a/docs/manpages/nlsr.rst b/docs/manpages/nlsr.rst
index 3dd0927..c047bf2 100644
--- a/docs/manpages/nlsr.rst
+++ b/docs/manpages/nlsr.rst
@@ -12,16 +12,12 @@
Description
-----------
-``nlsr`` is a daemon that implements routing protocol in NDN to populates NDN's Routing
+``nlsr`` is a process that implements routing protocol in NDN to populate NDN's Routing
Information Base.
Options:
--------
-
-``-d``
- Run in daemon mode
-
``-f <FILE>``
Specify configuration file name (default: ``./nlsr.conf``)
@@ -34,14 +30,8 @@
Examples
--------
-To run NLSR daemon and use a configuration file from the ``/path/to`` directory.
+To run NLSR and use a configuration file from the ``/path/to`` directory.
::
nlsr -f /path/to/nlsr.conf
-
-To run NLSR as daemon, use the ``-d`` flag:
-
-::
-
- nlsr -d