Might be a basic question, but I'm not sure why logging would cause this exit function to not work as expected:
#!/bin/bash
function exitFunct
{
exit 1
}
exitFunct 2>&1 | tee -a /var/tmp/output.txt
echo "You should never see this"
But output is "You should never see this"