I have simple datattable where i am displaying couple of columns ,on click of any row in datatable i need to get the value from Name column to JS for further processing

    <template>
    <lightning-datatable
            data={data}
            columns={columns}
            key-field="id"
            onrowselection={getNameRowData}>
    </lightning-datatable>
</template>

     JS - getNameRowData(event) {
        const selectedRows = event.detail.selectedRows;
        console.log('selectedRows>>'+selectedRows);
    }

but i am not able to see any logs printing in console.Please help