Tabnine Logo
Logger.error
Code IndexAdd Tabnine to your IDE (free)

How to use
error
method
in
org.slf4j.Logger

Best Java code snippets using org.slf4j.Logger.error (Showing top 20 results out of 132,201)

Refine searchRefine arrow

  • Logger.debug
  • Logger.info
  • Logger.warn
  • List.add
  • Map.get
  • Logger.isDebugEnabled
  • Map.put
  • List.size
origin: iluwatar/java-design-patterns

/**
 * Stops logging clients. This is a blocking call.
 */
public void stop() {
 service.shutdown();
 if (!service.isTerminated()) {
  service.shutdownNow();
  try {
   service.awaitTermination(1000, TimeUnit.SECONDS);
  } catch (InterruptedException e) {
   LOGGER.error("exception awaiting termination", e);
  }
 }
 LOGGER.info("Logging clients stopped");
}
origin: ctripcorp/apollo

@Override
@SuppressWarnings("unchecked")
public <T extends Provider> T provider(Class<T> clazz) {
 Provider provider = m_providers.get(clazz);
 if (provider != null) {
  return (T) provider;
 } else {
  logger.error("No provider [{}] found in DefaultProviderManager, please make sure it is registered in DefaultProviderManager ",
    clazz.getName());
  return (T) NullProviderManager.provider;
 }
}
origin: skylot/jadx

  public static void setClipboardString(String text) {
    try {
      Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
      Transferable transferable = new StringSelection(text);
      clipboard.setContents(transferable, null);
      LOG.debug("String '{}' copied to clipboard", text);
    } catch (Exception e) {
      LOG.error("Failed copy string '{}' to clipboard", text, e);
    }
  }
}
origin: alibaba/canal

private void notifyStart(File instanceDir, String destination, File[] instanceConfigs) {
  try {
    defaultAction.start(destination);
    actions.put(destination, defaultAction);
    // 启动成功后记录配置文件信息
    InstanceConfigFiles lastFile = lastFiles.get(destination);
    List<FileInfo> newFileInfo = new ArrayList<FileInfo>();
    for (File instanceConfig : instanceConfigs) {
      newFileInfo.add(new FileInfo(instanceConfig.getName(), instanceConfig.lastModified()));
    }
    lastFile.setInstanceFiles(newFileInfo);
    logger.info("auto notify start {} successful.", destination);
  } catch (Throwable e) {
    logger.error(String.format("scan add found[%s] but start failed", destination), e);
  }
}
origin: Netflix/eureka

private List<String> toDomains(List<String> ec2Urls) {
  List<String> domains = new ArrayList<>(ec2Urls.size());
  for(String url : ec2Urls) {
    try {
      domains.add(extractDomain(url));
    } catch(MalformedURLException e) {
      logger.error("Invalid url {}", url, e);
    }
  }
  return domains;
}
origin: ctripcorp/apollo

private void handleEnvDown(Env env) {
 int failedTimes = healthCheckFailedCounter.get(env);
 healthCheckFailedCounter.put(env, ++failedTimes);
 if (!envStatusMark.get(env)) {
  logger.error("Env is down. env: {}, failed times: {}, meta server address: {}", env, failedTimes,
         MetaDomainConsts.getDomain(env));
 } else {
  if (failedTimes >= ENV_DOWN_THRESHOLD) {
   envStatusMark.put(env, false);
   logger.error("Env is down because health check failed for {} times, "
          + "which equals to down threshold. env: {}, meta server address: {}", ENV_DOWN_THRESHOLD, env,
          MetaDomainConsts.getDomain(env));
  } else {
   logger.error(
     "Env health check failed for {} times which less than down threshold. down threshold:{}, env: {}, meta server address: {}",
     failedTimes, ENV_DOWN_THRESHOLD, env, MetaDomainConsts.getDomain(env));
  }
 }
}
origin: Graylog2/graylog2-server

@Override
public void onEvent(RawMessageEvent event, long sequence, boolean endOfBatch) throws Exception {
  batch.add(event);
    log.debug("End of batch, journalling {} messages", batch.size());
      writeToJournal(converter, entries);
    } catch (Exception e) {
      log.error("Unable to write to journal - retrying", e);
origin: alibaba/nacos

static public List<String> checkMd5() {
  List<String> diffList = new ArrayList<String>();
  long startTime = System.currentTimeMillis();
  for (Entry<String/* groupKey */, CacheItem> entry : CACHE.entrySet()) {
    String groupKey = entry.getKey();
    String[] dg = GroupKey.parseKey(groupKey);
    String dataId = dg[0];
    String group = dg[1];
    String tenant = dg[2];
    try {
      String loacalMd5 = DiskUtil.getLocalConfigMd5(dataId, group, tenant);
      if (!entry.getValue().md5.equals(loacalMd5)) {
        defaultLog.warn("[md5-different] dataId:{},group:{}",
          dataId, group);
        diffList.add(groupKey);
      }
    } catch (IOException e) {
      defaultLog.error("getLocalConfigMd5 fail,dataId:{},group:{}",
        dataId, group);
    }
  }
  long endTime = System.currentTimeMillis();
  defaultLog.warn("checkMd5 cost:{}; diffCount:{}", endTime - startTime,
    diffList.size());
  return diffList;
}
origin: Netflix/eureka

private List<AwsEndpoint> getClusterEndpointsFromConfig() {
  String[] availZones = clientConfig.getAvailabilityZones(clientConfig.getRegion());
  String myZone = InstanceInfo.getZone(availZones, myInstanceInfo);
  Map<String, List<String>> serviceUrls = EndpointUtils
      .getServiceUrlsMapFromConfig(clientConfig, myZone, clientConfig.shouldPreferSameZoneEureka());
  List<AwsEndpoint> endpoints = new ArrayList<>();
  for (String zone : serviceUrls.keySet()) {
    for (String url : serviceUrls.get(zone)) {
      try {
        endpoints.add(new AwsEndpoint(url, getRegion(), zone));
      } catch (Exception ignore) {
        logger.warn("Invalid eureka server URI: {}; removing from the server pool", url);
      }
    }
  }
  logger.debug("Config resolved to {}", endpoints);
  if (endpoints.isEmpty()) {
    logger.error("Cannot resolve to any endpoints from provided configuration: {}", serviceUrls);
  }
  return endpoints;
}
origin: gocd/gocd

private URL[] enumerateJar(URL urlOfJar) {
  LOGGER.debug("Enumerating jar: {}", urlOfJar);
  List<URL> urls = new ArrayList<>();
  urls.add(urlOfJar);
  try {
    JarInputStream jarStream = new JarInputStream(urlOfJar.openStream());
    JarEntry entry;
    while ((entry = jarStream.getNextJarEntry()) != null) {
      if (!entry.isDirectory() && entry.getName().endsWith(".jar")) {
        urls.add(expandJarAndReturnURL(jarStream, entry));
      }
    }
  } catch (IOException e) {
    LOGGER.error("Failed to enumerate jar {}", urlOfJar, e);
  }
  return urls.toArray(new URL[0]);
}
origin: apache/flink

  @Override
  public void log (int level, String category, String message, Throwable ex) {
    final String logString = "[KRYO " + category + "] " + message;
    switch (level) {
      case Log.LEVEL_ERROR:
        log.error(logString, ex);
        break;
      case Log.LEVEL_WARN:
        log.warn(logString, ex);
        break;
      case Log.LEVEL_INFO:
        log.info(logString, ex);
        break;
      case Log.LEVEL_DEBUG:
        log.debug(logString, ex);
        break;
      case Log.LEVEL_TRACE:
        log.trace(logString, ex);
        break;
    }
  }
}
origin: Activiti/Activiti

protected void logException() {
  if (exception instanceof JobNotFoundException || exception instanceof ActivitiTaskAlreadyClaimedException) {
    // reduce log level, because this may have been caused because of job deletion due to cancelActiviti="true"
    log.info("Error while closing command context",
         exception);
  } else if (exception instanceof ActivitiOptimisticLockingException) {
    // reduce log level, as normally we're not interested in logging this exception
    log.debug("Optimistic locking exception : " + exception);
  } else {
    log.error("Error while closing command context",
         exception);
  }
}
origin: ch.qos.logback/logback-classic

public void close() {
  closed = true;
  if (serverSocket != null) {
    try {
      serverSocket.close();
    } catch (IOException e) {
      logger.error("Failed to close serverSocket", e);
    } finally {
      serverSocket = null;
    }
  }
  logger.info("closing this server");
  synchronized (socketNodeList) {
    for (SocketNode sn : socketNodeList) {
      sn.close();
    }
  }
  if (socketNodeList.size() != 0) {
    logger.warn("Was expecting a 0-sized socketNodeList after server shutdown");
  }
}
origin: skylot/jadx

private static List<String> getZipFileList(File file) {
  List<String> filesList = new ArrayList<>();
  try (ZipFile zipFile = new ZipFile(file)) {
    Enumeration<? extends ZipEntry> entries = zipFile.entries();
    while (entries.hasMoreElements()) {
      ZipEntry entry = entries.nextElement();
      filesList.add(entry.getName());
    }
  } catch (Exception e) {
    LOG.error("Error read zip file '{}'", file.getAbsolutePath(), e);
  }
  return filesList;
}
origin: alibaba/fescar

@Override
public void onCheckMessage(long msgId, ChannelHandlerContext ctx, ServerMessageSender sender) {
  try {
    sender.sendResponse(msgId, ctx.channel(), HeartbeatMessage.PONG);
  } catch (Throwable throwable) {
    LOGGER.error("", "send response error", throwable);
  }
  if (LOGGER.isDebugEnabled()) {
    LOGGER.debug("received PING from " + ctx.channel().remoteAddress());
  }
}
origin: alibaba/canal

futures.add(groupInnerExecutorService.submit(() -> {
  try {
      batchSync(dmls, adapter);
      if (logger.isDebugEnabled()) {
        logger.debug("{} elapsed time: {}",
          adapter.getClass().getName(),
          (System.currentTimeMillis() - begin));
    return true;
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
    return false;
origin: skylot/jadx

  public void printReport() {
    if (getErrorCount() > 0) {
      LOG.error("{} errors occurred in following nodes:", getErrorCount());
      List<String> errors = new ArrayList<>(errorNodes.size());
      for (IAttributeNode node : errorNodes) {
        String nodeName = node.getClass().getSimpleName().replace("Node", "");
        errors.add(nodeName + ": " + node);
      }
      Collections.sort(errors);
      for (String err : errors) {
        LOG.error("  {}", err);
      }
    }
    if (getWarnsCount() > 0) {
      LOG.warn("{} warnings in {} nodes", getWarnsCount(), warnNodes.size());
    }
  }
}
origin: alibaba/canal

private void notifyStop(String destination) {
  InstanceAction action = actions.remove(destination);
  try {
    action.stop(destination);
    lastFiles.remove(destination);
    logger.info("auto notify stop {} successful.", destination);
  } catch (Throwable e) {
    logger.error(String.format("scan delete found[%s] but stop failed", destination), e);
    actions.put(destination, action);// 再重新加回去,下一次scan时再执行删除
  }
}
origin: alibaba/canal

private void loadConnector(OuterAdapterConfig config, List<OuterAdapter> canalOutConnectors) {
  try {
    OuterAdapter adapter;
    adapter = loader.getExtension(config.getName(), StringUtils.trimToEmpty(config.getKey()));
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    // 替换ClassLoader
    Thread.currentThread().setContextClassLoader(adapter.getClass().getClassLoader());
    adapter.init(config);
    Thread.currentThread().setContextClassLoader(cl);
    canalOutConnectors.add(adapter);
    logger.info("Load canal adapter: {} succeed", config.getName());
  } catch (Exception e) {
    logger.error("Load canal adapter: {} failed", config.getName(), e);
  }
}
origin: alibaba/canal

private void notifyReload(String destination) {
  InstanceAction action = actions.get(destination);
  if (action != null) {
    try {
      action.reload(destination);
      logger.info("auto notify reload {} successful.", destination);
    } catch (Throwable e) {
      logger.error(String.format("scan reload found[%s] but reload failed", destination), e);
    }
  }
}
org.slf4jLoggererror

Javadoc

Log a message at the ERROR level.

Popular methods of Logger

  • info
    This method is similar to #info(String,Object[])method except that the marker data is also taken int
  • debug
    This method is similar to #debug(String,Object[])method except that the marker data is also taken in
  • warn
    This method is similar to #warn(String,Object[])method except that the marker data is also taken int
  • isDebugEnabled
    Similar to #isDebugEnabled() method except that the marker data is also taken into account.
  • trace
    This method is similar to #trace(String,Object...)method except that the marker data is also taken i
  • isTraceEnabled
    Similar to #isTraceEnabled() method except that the marker data is also taken into account.
  • isInfoEnabled
    Similar to #isInfoEnabled() method except that the marker data is also taken into consideration.
  • isWarnEnabled
    Similar to #isWarnEnabled() method except that the marker data is also taken into consideration.
  • isErrorEnabled
    Similar to #isErrorEnabled() method except that the marker data is also taken into consideration.
  • getName
    Return the name of this Logger instance.

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • Menu (java.awt)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now