本文整理了Java中com.alibaba.dubbo.common.logger.Logger.error()
方法的一些代码示例,展示了Logger.error()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.error()
方法的具体详情如下:
包路径:com.alibaba.dubbo.common.logger.Logger
类名称:Logger
方法名:error
[英]输出错误信息
[中]输出错误信息
代码示例来源:origin: com.alibaba/dubbo
@Override
public void error(Throwable e) {
try {
logger.error(e);
} catch (Throwable t) {
}
}
代码示例来源:origin: com.alibaba/dubbo
@Override
public void run() {
// Check and connect to the registry
try {
connect();
} catch (Throwable t) { // Defensive fault tolerance
logger.error("Unexpected error occur at reconnect, cause: " + t.getMessage(), t);
}
}
}, reconnectPeriod, reconnectPeriod, TimeUnit.MILLISECONDS);
代码示例来源:origin: com.alibaba/dubbo
@Override
public void close() {
super.close();
try {
if (!checkModifiedFuture.isCancelled()) {
checkModifiedFuture.cancel(true);
}
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
代码示例来源:origin: com.alibaba/dubbo
@Override
public void sent(Channel channel, Object message) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.sent(channel, message);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: linux-china/dubbo3
public void connected(Channel channel) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.connected(channel);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: linux-china/dubbo3
public void disconnected(Channel channel) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.disconnected(channel);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: linux-china/dubbo3
public void sent(Channel channel, Object message) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.sent(channel, message);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: linux-china/dubbo3
public void run() {
// 收集统计信息
try {
retryFailed();
} catch (Throwable t) { // 防御性容错
logger.error("Unexpected error occur at collect statistic", t);
}
}
}, RETRY_FAILED_PERIOD, RETRY_FAILED_PERIOD, TimeUnit.MILLISECONDS);
代码示例来源:origin: linux-china/dubbo3
public void sent(Channel channel, Object message) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.sent(channel, message);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: com.alibaba/dubbo
@Override
public void caught(Channel channel, Throwable exception) {
for (ChannelHandler listener : channelHandlers) {
try {
listener.caught(channel, exception);
} catch (Throwable t) {
logger.error(t.getMessage(), t);
}
}
}
代码示例来源:origin: com.alibaba/dubbo
@Override
public void error(String msg, Throwable e) {
try {
logger.error(appendContextMessage(msg), e);
} catch (Throwable t) {
}
}
代码示例来源:origin: dubboclub/dubbo-plus
protected byte[] generateCacheKey(Object key){
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(objectToBytes(cachedUrl,key));
byteArrayOutputStream.write(cacheName);
return byteArrayOutputStream.toByteArray();
} catch (IOException e) {
logger.error("Failed to generate cache key for object ["+key.toString()+"]",e);
return null;
}
}
代码示例来源:origin: dubboclub/dubbo-plus
protected byte[] generateCacheKey(Object key){
try {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
byteArrayOutputStream.write(objectToBytes(cachedUrl,key));
byteArrayOutputStream.write(cacheName);
return byteArrayOutputStream.toByteArray();
} catch (IOException e) {
logger.error("Failed to generate cache key for object ["+key.toString()+"]",e);
return null;
}
}
代码示例来源:origin: com.alibaba/dubbo-common
@Override
public void error(String msg) {
try {
logger.error(appendContextMessage(msg));
} catch (Throwable t) {
}
}
代码示例来源:origin: com.alibaba/dubbo
@Override
public void run() {
try {
client = listenableFutureTask.get();
client.subscribeStateChanges(listener);
} catch (InterruptedException e) {
logger.warn(Thread.currentThread().getName() + " was interrupted unexpectedly, which may cause unpredictable exception!");
} catch (ExecutionException e) {
logger.error("Got an exception when trying to create zkclient instance, can not connect to zookeeper server, please check!", e);
}
}
});
代码示例来源:origin: com.alibaba/dubbo
@Override
public void close() {
try {
leave();
} catch (RemotingException e) {
logger.error(e.getMessage(), e);
}
}
代码示例来源:origin: linux-china/dubbo3
protected static void checkPayload(Channel channel, long size) throws IOException {
int payload = Constants.DEFAULT_PAYLOAD;
if (channel != null && channel.getUrl() != null) {
payload = channel.getUrl().getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD);
}
if (payload > 0 && size > payload) {
IOException e = new IOException("Data length too large: " + size + ", max payload: " + payload + ", channel: " + channel);
logger.error(e);
throw e;
}
}
代码示例来源:origin: linux-china/dubbo3
public void referred(Invoker<?> invoker) throws RpcException {
if (invoker.getUrl().getParameter(Constants.DEPRECATED_KEY, false)) {
LOGGER.error("The service " + invoker.getInterface().getName() + " is DEPRECATED! Declare from " + invoker.getUrl());
}
}
代码示例来源:origin: linux-china/dubbo3
public void referred(Invoker<?> invoker) throws RpcException {
if (invoker.getUrl().getParameter(Constants.DEPRECATED_KEY, false)) {
LOGGER.error("The service " + invoker.getInterface().getName() + " is DEPRECATED! Declare from " + invoker.getUrl());
}
}
代码示例来源:origin: com.alibaba/dubbo
protected static void checkPayload(Channel channel, long size) throws IOException {
int payload = Constants.DEFAULT_PAYLOAD;
if (channel != null && channel.getUrl() != null) {
payload = channel.getUrl().getParameter(Constants.PAYLOAD_KEY, Constants.DEFAULT_PAYLOAD);
}
if (payload > 0 && size > payload) {
ExceedPayloadLimitException e = new ExceedPayloadLimitException("Data length too large: " + size + ", max payload: " + payload + ", channel: " + channel);
logger.error(e);
throw e;
}
}
内容来源于网络,如有侵权,请联系作者删除!