Add hooks to perform logging