How to collect log and gathering log with elastic & kibana from WEBSITE

Hello
I am using the Elasticsearch, Logstash, and Kibana collect log a website
Elasticsearch, Logstash, and Kibana How does this ?
The API uses of the website?
Javascript code is?
Or the other way?

with RESTful API ?