org.jboss.logging.Logger.init()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(231)

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

Logger.init介绍

[英]Initialize the LoggerPlugin class to use as the delegate to the logging system. This first checks to see if a pluginClassName has been specified via the #setPluginClassName(String) method, then the PLUGIN_CLASS_PROP system property and finally the LOG4J_PLUGIN_CLASS_NAME default. If the LoggerPlugin implementation class cannot be loaded the default NullLoggerPlugin will be used.
[中]初始化LoggerPlugin类以用作日志系统的委托。首先检查是否通过#setPluginClassName(String)方法指定了pluginClassName,然后检查PLUGIN_CLASS_PROP系统属性,最后检查LOG4J_PLUGIN_CLASS_默认名称。如果无法加载LoggerPlugin实现类,则将使用默认的NullLoggerPlugin。

代码示例

代码示例来源:origin: jboss.logging/jboss-logging-spi

  1. /** Set the LoggerPlugin implementation class name in use
  2. * @param pluginClassName the LoggerPlugin implementation class name
  3. */
  4. public static void setPluginClassName(String pluginClassName)
  5. {
  6. if( pluginClassName.equals(Logger.pluginClassName) == false )
  7. {
  8. Logger.pluginClassName = pluginClassName;
  9. init();
  10. }
  11. }

代码示例来源:origin: jboss/jboss-logging-spi

  1. /**
  2. * Set the LoggerPlugin implementation class name in use
  3. *
  4. * @param pluginClassName the LoggerPlugin implementation class name
  5. */
  6. public static void setPluginClassName(String pluginClassName)
  7. {
  8. if (pluginClassName.equals(Logger.pluginClassName) == false)
  9. {
  10. Logger.pluginClassName = pluginClassName;
  11. init();
  12. }
  13. }

代码示例来源:origin: org.jboss.logging/jboss-logging-spi

  1. /**
  2. * Set the LoggerPlugin implementation class name in use
  3. *
  4. * @param pluginClassName the LoggerPlugin implementation class name
  5. */
  6. public static void setPluginClassName(String pluginClassName)
  7. {
  8. if (! pluginClassName.equals(Logger.pluginClassName))
  9. {
  10. Logger.pluginClassName = pluginClassName;
  11. init();
  12. }
  13. }

代码示例来源:origin: org.jboss.logging/jboss-logging-spi

  1. /**
  2. * Custom serialization to reinitalize the delegate
  3. *
  4. * @param stream the object stream
  5. * @throws IOException for any error
  6. * @throws ClassNotFoundException if a class is not found during deserialization
  7. */
  8. private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
  9. {
  10. // restore non-transient fields (aka name)
  11. stream.defaultReadObject();
  12. // Restore logging
  13. if (pluginClass == null)
  14. {
  15. init();
  16. }
  17. }

代码示例来源:origin: jboss.logging/jboss-logging-spi

  1. private void readObject(java.io.ObjectInputStream stream)
  2. throws java.io.IOException, ClassNotFoundException
  3. {
  4. // restore non-transient fields (aka name)
  5. stream.defaultReadObject();
  6. // Restore logging
  7. if (pluginClass == null)
  8. {
  9. init();
  10. }
  11. this.loggerDelegate = getDelegatePlugin(name);
  12. }

代码示例来源:origin: jboss/jboss-logging-spi

  1. /**
  2. * Custom serialization to reinitalize the delegate
  3. *
  4. * @param stream the object stream
  5. * @throws IOException for any error
  6. * @throws ClassNotFoundException if a class is not found during deserialization
  7. */
  8. private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
  9. {
  10. // restore non-transient fields (aka name)
  11. stream.defaultReadObject();
  12. // Restore logging
  13. if (pluginClass == null)
  14. {
  15. init();
  16. }
  17. this.loggerDelegate = getDelegatePlugin(name);
  18. }

相关文章