Fix bug in logging
Merge pull request #4165 from torhve/develop

Fix bug in logging