Add test for logging capture.