About the Logging System

The DTN2 implementation uses the logging facility from oasys. It supports multiple log paths and different log levels for each log path.

If the file ~/.dtndebug exists, it can be used to customize which log messages are emitted and which are ignored. It is read one line at a time. Lines may start with "#" to indicate a comment. Blank lines are ignored. Any other line should have a logpath in the left column, and a log level in the right column. The columns are separated by spaces and/or tabs.

For instance, this .dtndebug file makes the default level info, but causes debug info to be printed for all link operations other than for tcp0.

# example .dtndebug file

/		info
/link/tcp0	info
/link		debug

In dtnd, the log messages go out to standard out, by default. You can change that using the "-o filename" option to dtnd.

Here is the list of the logging levels:

Below is an incomplete list of log paths used by the DTN2 implementation. You can find others by observing output with logging turned up to the maximum ("/ debug") or by searching for logpath in the source code.

/dtnd dtnd server startup/operation
/dtnserver dtnd internals
/interface interface management
/link/$linkname link management
/storage/$dbtype database operations
/route routing related messages
/tcl Errors from TCL (the underlying interpreter)
/assert Failing assertions
/apisrv API Server
/apisrv/sock API Server (socket-specific messages)
/cl/tcp TCP Convergence Layer
/cl/tcp/conn/$ip:$port connection specific messages
/cl/udp UDP Convergence Layer
/contact/bundles  
/registration  

Rereading the .dtndebug file

You can force the daemon to reread the .dtndebug file while it is running by sending it a HUP signal. You can also use the log reparse_debug_file TCL command.

Rotating the log file

You can send the daemon the USR1 signal to make it reopen the log file. You could use a shell script like this to roll the log file and start a new one:

mv log.txt log-`date +%Y-%m-%d`.txt
pkill -USR1 dtnd

You can also rotate the log file from inside the TCL interpreter using the log rotate TCL command.