Implement log command