1

I have a single page web application based on a react/redux stack as the frontend and Java (Jetty) server as the backend. All server side logs are written to files and filebeat transfers them to a centralized ELK.

What is the best practice method for sending client (browser) logs to the same centralized ELK?

-------------- EDIT --------------

One possibility is to create a new entry in Nginx which will write the logs and access it from the client. How can I config Nginx to such functionality? (links in comments)

Will Barnwell
  • 4,049
  • 21
  • 34
Shai M.
  • 1,284
  • 4
  • 17
  • 30
  • [logging-post-data in nginx](http://stackoverflow.com/questions/4939382/logging-post-data-from-request-body) – Shai M. Aug 24 '16 at 07:00
  • [logging-post-data in nginx 2](http://stackoverflow.com/questions/17609472/really-logging-the-post-request-body-instead-of-with-nginx) – Shai M. Aug 24 '16 at 07:00
  • I'm confused what you mean by "client-side logs". All requests made by a client will hit the Nginx server and the logs are stored there. – OneCricketeer Aug 24 '16 at 18:02
  • I meant what are the best practices for saving web application logs to centralized ELK. It required for the production environment. – Shai M. Aug 24 '16 at 19:18
  • Personally, I find filebeat to work fine. Might try syslog from Nginx into logstash, if that's a thing – OneCricketeer Aug 24 '16 at 22:32
  • @cricket_007 he means precisely what he said: logging done on the client-side, in his JavaScript code, for instance through `console.log` calls. The OP wants a design that will let him capture such logs and push them into his ELK stack. – Mark Amery Nov 09 '17 at 13:08
  • @Mark Fine. Then I would suggest use the Elasticsearch REST API rather than `console.log` – OneCricketeer Nov 09 '17 at 13:14

0 Answers0