call back before logging