Changed logger to be created on the stack