org.apache.log4j.Appender.requiresLayout()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(152)

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

Appender.requiresLayout介绍

[英]Configurators call this method to determine if the appender requires a layout. If this method returns true, meaning that layout is required, then the configurator will configure an layout using the configuration information at its disposal. If this method returns false, meaning that a layout is not required, then layout configuration will be skipped even if there is available layout configuration information at the disposal of the configurator..

In the rather exceptional case, where the appender implementation admits a layout but can also work without it, then the appender should return true.
[中]配置程序调用此方法以确定追加器是否需要布局。如果此方法返回true,意味着需要布局,则配置程序将使用其可支配的配置信息配置布局。如果此方法返回false,意味着不需要布局,则即使配置程序有可用的布局配置信息,也将跳过布局配置。。
在相当特殊的情况下,如果appender实现允许布局,但也可以在没有布局的情况下工作,那么appender应该返回true

代码示例

代码示例来源:origin: log4j/log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: apache/log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: org.sakaiproject.kernel/sakai-kernel-impl

public boolean requiresLayout()
{
  return m_other.requiresLayout();
}

代码示例来源:origin: camunda/camunda-bpm-platform

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: org.terracotta/terracotta-l1-ee

@Override
public boolean requiresLayout() {
 return delegate().requiresLayout();
}

代码示例来源:origin: org.terracotta/terracotta-l1

@Override
public boolean requiresLayout() {
 return delegate().requiresLayout();
}

代码示例来源:origin: org.terracotta/terracotta-ee

@Override
public boolean requiresLayout() {
 return delegate().requiresLayout();
}

代码示例来源:origin: org.ops4j.pax.logging/pax-logging-service

public OptionHandler create(Properties variables)
  {
    Properties props = new Properties();
    props.putAll(variables);
    props.putAll(properties);
    OptionHandler opt = (OptionHandler) OptionConverter.instantiateByKey(props, prefix,
               OptionHandler.class,
               null);
    if (opt instanceof Appender && ((Appender) opt).requiresLayout())
    {
      Layout layout = (Layout) OptionConverter.instantiateByKey(props,
          prefix + ".layout",
          Layout.class,
          null);
      if (layout != null)
      {
        ((Appender) opt).setLayout(layout);
        PaxPropertySetter.setProperties(layout, props, prefix + ".layout.");
      }
    }
    PaxPropertySetter.setProperties(opt, props, prefix + ".");
    opt.activateOptions();
    return opt;
  }
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

public OptionHandler create(Properties variables)
  {
    Properties props = new Properties();
    props.putAll(variables);
    props.putAll(properties);
    OptionHandler opt = (OptionHandler) OptionConverter.instantiateByKey(props, prefix,
               OptionHandler.class,
               null);
    if (opt instanceof Appender && ((Appender) opt).requiresLayout())
    {
      Layout layout = (Layout) OptionConverter.instantiateByKey(props,
          prefix + ".layout",
          Layout.class,
          null);
      if (layout != null)
      {
        ((Appender) opt).setLayout(layout);
        PaxPropertySetter.setProperties(layout, props, prefix + ".layout.");
      }
    }
    PaxPropertySetter.setProperties(opt, props, prefix + ".");
    opt.activateOptions();
    return opt;
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: org.jboss.logmanager/log4j-jboss-logmanager

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: org.apache.log4j/com.springsource.org.apache.log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: ops4j/org.ops4j.pax.logging

if (appender.requiresLayout())

代码示例来源:origin: org.ops4j.pax.logging/pax-logging-service

if (appender.requiresLayout())

代码示例来源:origin: apache-log4j/log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

代码示例来源:origin: org.apache/log4j

if(appender.requiresLayout()) {
Layout layout = (Layout) OptionConverter.instantiateByKey(props,
               layoutPrefix,

相关文章