set logfile as instance variable rather than pass to every method