1.加入异常日志。

2.避免span保存异常时,影响业务程序。
This commit is contained in:
wusheng 2016-02-24 15:34:52 +08:00
parent e03e9f2583
commit 2b3a2da209
1 changed files with 9 additions and 1 deletions

View File

@ -4,9 +4,13 @@ import com.ai.cloud.skywalking.protocol.Span;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import static com.ai.cloud.skywalking.conf.Config.Buffer.POOL_SIZE;
public class ContextBuffer {
private static Logger logger = LogManager.getLogger(ContextBuffer.class);
private static BufferPool pool = new BufferPool();
@ -15,7 +19,11 @@ public class ContextBuffer {
}
public static void save(Span span) {
pool.save(span);
try{
pool.save(span);
}catch(Throwable t){
logger.error("save span error.", t);
}
}