Don't use error() before setting up logoutput.