Make several logging improvements.