Add logging code.