error logging in prod mode, show error trace in dev mode