address data race in test around logger.

* add test logger to collect data and return, rather than using real files