Added logging feature