Write test log files into the correct directory.