Fix logging Ant task bugs

The bug was introduced in 040aa1804395c91fb6b016ca1f8873355f2bfbea.