Improve and fix logging in various places

This patch improves several log statements by adding more meaningful information. In same rare cases logging was broken because the required parameters were missing. This shold be fixed as well.