Moved logger declaration into main method.