org.apache.openejb.util.Logger类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.apache.openejb.util.Logger类的一些代码示例,展示了Logger类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger类的具体详情如下:
包路径:org.apache.openejb.util.Logger
类名称:Logger

Logger介绍

暂无

代码示例

代码示例来源:origin: org.apache.tomee/openejb-core

public void log(final String level, final String message) {
  final String levelLowerCase = level.toLowerCase(Locale.ENGLISH);
  if ("info".equals(levelLowerCase)) {
    info(message);
  } else if ("debug".equals(levelLowerCase)) {
    debug(message);
  } else if ("warning".equals(levelLowerCase)) {
    warning(message);
  } else if ("fatal".equals(levelLowerCase)) {
    fatal(message);
  } else if ("error".equals(levelLowerCase)) {
    error(message);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-core

@Override
  public void run() {
    try {
      //Force a shutdown without waiting for jobs to complete.
      s.shutdown(false);
      Logger.getInstance(LogCategory.OPENEJB, "org.apache.openejb.util.resources").warning("Forced Quartz stop - Jobs may be incomplete");
    } catch (final Throwable e) {
      QuartzResourceAdapter.this.ex.set(e);
    }
  }
};

代码示例来源:origin: org.apache.openejb/openejb-core

private static void logExclusions(final String[] exclusionArray) {
  if (logger.isDebugEnabled()) {
    logger.debug("Exclusion prefixes: [");
    for (final String ex : exclusionArray) {
      logger.debug("-" + ex);
    }
    logger.debug("]");
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
  public void run() {
    try {
      stopImpl();
    } catch (final Throwable t) {
      Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQResourceAdapter.class).getChildLogger("service").error("ActiveMQ shutdown failed", t);
    }
  }
};

代码示例来源:origin: org.apache.openejb/openejb-core

public String debug(final String message, final Throwable t, final Object... args) {
  if (isDebugEnabled()) {
    String msg = getMessage(message, baseName);
    msg = formatMessage(msg, args);
    logStream.debug(msg, t);
    return msg;
  }
  return message;
}

代码示例来源:origin: org.apache.tomee/openejb-core

public static void configurationParsingError(final String messageType, final String message, final String line, final String column) {
  _logger.error("as0001", messageType, message, line, column);
  /*
   * An error broadcasting system is under development.
   * At this point an appropriate error would be broadcast to all listeners.
   */
}

代码示例来源:origin: org.apache.openejb/openejb-ejbd

private EJBResponse setResponseError(final EJBResponse res, final byte version, final Throwable error, final String message) {

    //This is fatal for the client, but not the server.
    if (logger.isInfoEnabled()) {
      logger.info(message + " - Enable DEBUG for stacktrace: " + error);
    } else if (logger.isDebugEnabled()) {
      logger.debug(message, error);
    }

    final RemoteException re = new RemoteException(message, error);
    res.setResponse(version, ResponseCodes.EJB_ERROR, new ThrowableArtifact(re));
    return res;
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
  public void run() {
    for (final String mapping : mappings) {
      try {
        addFilterMethod.invoke(null, clazz.getName(), webContext, mapping, config);
        deployedWebObjects.filterMappings.add(mapping);
      } catch (final Exception e) {
        LOGGER.warning(e.getMessage(), e);
      }
    }
  }
});

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

public void rollback() throws IllegalStateException, SecurityException, SystemException {
  if (transactionLogger.isInfoEnabled()) {
    transactionLogger.info("Rolling back user transaction " + transactionManager().getTransaction());
  }
  transactionManager().rollback();
}

代码示例来源:origin: org.apache.openejb/openejb-hsql

private void flushLine() {
  if (!errorWriter)
    logger.info(text.toString());
  else
    logger.error(text.toString());
  text.setLength(0);
}

代码示例来源:origin: org.apache.tomee/openejb-core

public void start() {
  logger.info("Initializing network services");
  final Method start = getMethod("start", boolean.class);
  invoke(start, serviceManager, false);
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

protected void setRollbackOnly(Transaction tx) {
  try {
    if (tx != null && tx.getStatus() == Status.STATUS_ACTIVE) {
      tx.setRollbackOnly();
      txLogger.debug("TX {0}: setRollbackOnly() on transaction {1}", transactionType, tx);
    }
  } catch (Exception e) {
    txLogger.error("Exception during setRollbackOnly()", e);
    throw new IllegalStateException("No transaction active", e);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-core

public void afterCompletion(final int i) {
    entityManager.close();
    logger.debug("Closed EntityManager(unit=" + unitName + ", hashCode=" + entityManager.hashCode() + ")");
  }
}

代码示例来源:origin: org.apache.tomee/openejb-cxf

private static void loadOASISCatalog(Bus bus, URL catalogURL) {
    OASISCatalogManager catalog = new OASISCatalogManager();
    try {
      catalog.loadCatalog(catalogURL);
      logger.debug("Loaded " + catalogURL + " catalog.");
      bus.setExtension(catalog, OASISCatalogManager.class);
    } catch (IOException e) {
      logger.warning("Failed to load catalog file: " + catalogURL, e);
    }
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

@PostConstruct
public void PostConstruct(final InvocationContext invocationContext) throws Exception {
  final long start = System.nanoTime();
  record(invocationContext, PostConstruct());
  final long end = System.nanoTime();
  Logger.getInstance(LogCategory.MONITORING, "org.apache.openejb.monitoring")
      .debug("instance.created", invocationContext.getTarget().getClass().getName(), end - start);
}

代码示例来源:origin: org.apache.openejb/openejb-core

private static Logger logger() { // don't trigger init too eagerly to be sure to be configured
  if (logger == null) {
    logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, OpenEjbContainer.class);
  }
  return logger;
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core

public String info(String message, Object... args) {
  if (isInfoEnabled()) {
    String msg = getMessage(message, baseName);
    msg = formatMessage(msg, args);
    logStream.info(msg);
    return msg;
  }
  return message;
}

代码示例来源:origin: org.apache.openejb/openejb-core

public String debug(final String message, final Throwable t) {
  if (isDebugEnabled()) {
    final String msg = getMessage(message, baseName);
    logStream.debug(msg, t);
    return msg;
  }
  return message;
}

代码示例来源:origin: org.apache.openejb/openejb-core

private void tomeeConfig(final BrokerService broker) {
  //Notify when an error occurs on shutdown.
  broker.setUseLoggingForShutdownErrors(Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQ5Factory.class).isErrorEnabled());
}

代码示例来源:origin: org.apache.tomee/openejb-core

public String info(final String message, final Throwable t) {
  if (isInfoEnabled()) {
    final String msg = getMessage(message, baseName);
    logStream.info(msg, t);
    return msg;
  }
  return message;
}

相关文章