Only log 404 when debugging unit tests

Only log 404 when debugging unit tests.