You may be interested to know that the author of NLopt has stated on more than one occasion that he considers Nelder-Mead to be obsolete, and that other algorithms should typically be selected.
For NLopt, I believe that the recommended way to trace the calls to your objective is to pass a “wrapper” function to the optimizer that calls your actual objective function, then prints the desired information before returning the objective function value.