What happens if Elasticsearch is not reachable from your application? Does it handle that gracefully or does it introduce failures / you need to wait for requests to time out? Degraded logging should probably not impact your production system.
Logging to a JSON file and then inserting that directly into Elasticsearch with Filebeat could be a good solution as well. Monolog (https://github.com/Seldaek/monolog) is pretty widely used and can do it. Alternatively it supports Logstash and Elasticsearch outputs directly as well.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.