org.apache.openejb.util.Logger.getInstance()方法的使用及代码示例

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

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

Logger.getInstance介绍

[英]Finds a Logger from the cache and returns it. If not found in cache then builds a Logger and returns it.
[中]从缓存中查找记录器并返回它。如果在缓存中找不到,则构建一个记录器并返回它。

代码示例

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

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

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

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

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

  1. public HsqlPrintWriter(final boolean errorWriter) {
  2. super(System.err);
  3. logger = Logger.getInstance(LogCategory.OPENEJB_HSQL, HsqlPrintWriter.class);
  4. this.errorWriter = errorWriter;
  5. }

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

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

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

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

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

  1. public OpenEJBCommonsLog(final String category) {
  2. this.category = category;
  3. logger = Logger.getInstance(LogCategory.OPENEJB, category);
  4. }

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

  1. public LoggingPrintWriter(final String category) {
  2. super(System.err);
  3. logger = Logger.getInstance(LogCategory.OPENEJB.createChild(category), LoggingPrintWriter.class.getName());
  4. }

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

  1. public void release() {
  2. for (final CreationalContext<?> cc : creationalContexts.values()) {
  3. try {
  4. cc.release();
  5. } catch (final RuntimeException re) {
  6. Logger.getInstance(LogCategory.OPENEJB, WebContext.class.getName())
  7. .warning("Can't release properly a creational context", re);
  8. }
  9. }
  10. creationalContexts.clear();
  11. }

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

  1. @Override
  2. public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
  3. try {
  4. return method.invoke(findBm(), args);
  5. } catch (final InvocationTargetException ite) {
  6. Logger.getInstance(LogCategory.OPENEJB_JPA, EntityManagerFactoryCallable.class)
  7. .warning("Exception calling CDI, if a lifecycle issue you should maybe set tomee.jpa.factory.lazy=true", ite.getCause());
  8. throw ite.getCause();
  9. }
  10. }

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

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

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

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

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

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

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

  1. @PreDestroy
  2. public void PreDestroy(final InvocationContext invocationContext) throws Exception {
  3. final long start = System.nanoTime();
  4. record(invocationContext, PreDestroy());
  5. final long end = System.nanoTime();
  6. Logger.getInstance(LogCategory.MONITORING, "org.apache.openejb.monitoring")
  7. .debug("instance.discarded", invocationContext.getTarget().getClass().getName(), end - start);
  8. }

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

  1. @Override
  2. public void run() {
  3. try {
  4. stopImpl();
  5. } catch (final Throwable t) {
  6. Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQResourceAdapter.class).getChildLogger("service").error("ActiveMQ shutdown failed", t);
  7. }
  8. }
  9. };

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

  1. public Tracker build() {
  2. logger = Logger.getInstance(LogCategory.OPENEJB_SERVER.createChild("discovery"), Tracker.class);
  3. return new Tracker(group, heartRate, maxMissedHeartbeats, reconnectDelay, maxReconnectDelay, maxReconnectAttempts, exponentialBackoff, logger, debug);
  4. }
  5. }

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

  1. @Override
  2. public void run() {
  3. try {
  4. stopImpl();
  5. } catch (final Throwable t) {
  6. Logger.getInstance(LogCategory.OPENEJB_STARTUP, ActiveMQResourceAdapter.class).getChildLogger("service").error("ActiveMQ shutdown failed", t);
  7. }
  8. }
  9. };

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

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

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

  1. private ScheduledExecutorService createScheduledExecutorService() {
  2. ManagedThreadFactory managedThreadFactory;
  3. try {
  4. managedThreadFactory = ThreadFactories.findThreadFactory(threadFactory);
  5. } catch (final Exception e) {
  6. Logger.getInstance(LogCategory.OPENEJB, ManagedScheduledExecutorServiceImplFactory.class).warning("Unable to create configured thread factory: " + threadFactory, e);
  7. managedThreadFactory = new ManagedThreadFactoryImpl();
  8. }
  9. return new ScheduledThreadPoolExecutor(core, managedThreadFactory, CURejectHandler.INSTANCE);
  10. }

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

  1. @Override
  2. public void init(final Properties props) throws Exception {
  3. this.logger = Logger.getInstance(LogCategory.OPENEJB_SERVER.createChild("service." + getName()), "org.apache.openejb.server.util.resources");
  4. this.debug = this.logger.isDebugEnabled();
  5. super.init(props);
  6. }

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

  1. public LiveReloadEndpoint() {
  2. this.watcher = Instances.get().getWatcher();
  3. this.mapper = Instances.get().getMapper();
  4. this.logger = Logger.getInstance(Instances.get().getLogCategory(), LiveReloadEndpoint.class);
  5. }

相关文章