Elastic stack for Node & Angular

Hi,

We have recently started to setup centralized logging for our projects using Elastic stack. The projects are built with Angular as the frontend framework & NodeJS as the middleware. Please suggest on how to send the application logs, from both Angular & NodeJS layer, to elasticsearch.

Your options are;

  • Log to a file and then use Filebeat to send it to Elasticsearch
  • Send it to something like a message broker/queue (kafka etc)
  • Send it to Elasticsearch directly

I'd say that the first one makes the most sense, as the file will act as a buffer, in case Filebeat cannot talk to Elasticsearch, and as a backup in case you want to reprocess.

Thank you for the response.

With regard to approach 3 i.e. sending the log directly to elastic - is there any impact on the elastic search performance due to continuous API POST requests?

I would recommend writing to file as this prevents issues in the application if Elasticsearch is temporarily unavailable for any reason.

Sure thank you.