access to the log is moved out of the method