Commit e5e45042 authored by Quxl's avatar Quxl

x

parent c7202cb3
...@@ -19,6 +19,8 @@ import com.google.common.util.concurrent.FutureCallback; ...@@ -19,6 +19,8 @@ import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import io.netty.util.internal.ThrowableUtil;
@Component @Component
public class AliyunLogProducer { public class AliyunLogProducer {
...@@ -75,11 +77,12 @@ public class AliyunLogProducer { ...@@ -75,11 +77,12 @@ public class AliyunLogProducer {
} }
@Override @Override
public void onFailure(Throwable errors) { public void onFailure(Throwable e) {
if (errors instanceof ResultFailedException) { if (e instanceof ResultFailedException) {
Result result = ((ResultFailedException) errors).getResult(); Result result = ((ResultFailedException) e).getResult();
LOGGER.error("Failed to send logs, project={}, logStore={}, result={}, log={}", project, logStore, result, logText); LOGGER.error("Failed to send logs, project={}, logStore={}, result={}, log={}", project, logStore, result, logText);
} else { } else {
String errors = ThrowableUtil.stackTraceToString(e);
LOGGER.error("Failed to send logs, project={}, logStore={}, errors={}, log={}", project, logStore, errors, logText); LOGGER.error("Failed to send logs, project={}, logStore={}, errors={}, log={}", project, logStore, errors, logText);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment