diff --git a/plugins/out_es/es.c b/plugins/out_es/es.c index 04f59eba4b2..f8be71a6fd7 100644 --- a/plugins/out_es/es.c +++ b/plugins/out_es/es.c @@ -513,7 +513,7 @@ static int cb_es_init(struct flb_output_instance *ins, ctx = flb_calloc(1, sizeof(struct flb_elasticsearch)); if (!ctx) { - flb_errno(); + flb_plg_error(ins, "cannot initialize plugin"); return -1; } ctx->ins = ins; diff --git a/plugins/out_es/es_conf.c b/plugins/out_es/es_conf.c index 7b29f235765..c9d3e34ffa0 100644 --- a/plugins/out_es/es_conf.c +++ b/plugins/out_es/es_conf.c @@ -277,7 +277,7 @@ int es_config_ha(const char *upstream_file, ctx->ha_mode = FLB_TRUE; ctx->ha = flb_upstream_ha_from_file(upstream_file, config); if (!ctx->ha) { - flb_error("[out_es] cannot load Upstream file"); + flb_plg_error(ctx->ins, "cannot load Upstream file"); return -1; } @@ -296,7 +296,7 @@ int es_config_ha(const char *upstream_file, ec = flb_calloc(1, sizeof(struct flb_elasticsearch_config)); if (!ec) { flb_errno(); - flb_error("[out_es] failed config allocation"); + flb_plg_error(ctx->ins, "failed config allocation"); continue; }