refactor ES logging (again) to respect ES_DEBUG env var