Want to see external task error logs in java script

From rest api to get error logs of a external task “externaltaskId” is required how to get this “externaltaskId”.
And what are other ways to get error logs of external task.

Can i see the errors in external worker itself?? please tell how to see errore