ElasticSearchOutput error output and connection resilience

Closes #1008.