Replace debug output by logger calles