Mer logging

Forward port useful changes in logging