Add data logging functions.