Either:
$ CCND_LOG="./ccnd.log" ccnd
Or:
$ export CCND_LOG="./ccnd.log"
$ ccnd
The first sets the environment for the command; the second sets the environment until it is changed. All environment variables are also shell variables; not all shell variables are environment variables. Until it is exported, a variable is just a shell variable; once it is exported, it becomes part of the environment.
If you are using a C shell derivative (such as tcsh), you'd have to use the setenv command to create an environment variable; the first variant is not an option with C shell.
% setenv CCND_LOG ./ccnd_log
% ccnd
If you're using bash, either of the first two should set the environment for the duration of the command. Use the export notation. Then run env | grep CCND to check that it is set.
I see that the CCNx Documentation says:
All CCNx programs require that a ccnd be running:
bin/ccndstart
To start ccnd sending output to a log file instead of the terminal,
set the CCND_LOG environment variable with the path of the file you
want to write. Any existing file with that name will be overwritten.
For a listing of other environment variables that are available
(including debug message controls) run:
bin/ccnd -h
Note that you should not ordinarily run ccnd directly, but use the
ccndstart script.
(Emphasis added.)
Are you running ccnd or ccndstart?
tcshorbashas your shell? By default, Mac OS X usestcsh, which is a C shell derivative.bash.ccndtool is still writing its log in my terminal.