Implement log command.