Adding CompatLogger object. #7225.

moved from master branch.