add environment variable to enable logging during tests

closes 1/2 of #2571