try {
clientProvider.getClient().Log(logEntries);
return true;
} catch (final TException e) {
LOGGER.debug("Exception when trying to log Span. Will retry: ", e.getMessage());
final Client newClient = clientProvider.exception(e);
if (newClient != null) {
LOGGER.debug("Got new client with new connection. Logging with new client.");
try {
newClient.Log(logEntries);
return true;
} catch (final TException e2) {
LOGGER.warn("Logging spans failed. " + logEntries.size() + " spans are lost!", e2);
}
} else {