Log4jAppender.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:flume-release-1.7.0 作者:
/**
 * Closes underlying client.
 * If <tt>append()</tt> is called after this function is called,
 * it will throw an exception.
 * @throws FlumeException if errors occur during close
 */
@Override
public synchronized void close() throws FlumeException {
  // Any append calls after this will result in an Exception.
  if (rpcClient != null) {
    try {
      rpcClient.close();
    } catch (FlumeException ex) {
      LogLog.error("Error while trying to close RpcClient.", ex);
      if (unsafeMode) {
        return;
      }
      throw ex;
    } finally {
      rpcClient = null;
    }
  } else {
    String errorMsg = "Flume log4jappender already closed!";
    LogLog.error(errorMsg);
    if (unsafeMode) {
      return;
    }
    throw new FlumeException(errorMsg);
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号