Do logging properly