org.apache.logging.log4j.core.Layout.getFooter()方法的使用及代码示例

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

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

Layout.getFooter介绍

[英]Returns the format for the layout format.
[中]返回布局格式的格式。

代码示例

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

@Override
public boolean stop(final long timeout, final TimeUnit timeUnit) {
  setStopping();
  super.stop(timeout, timeUnit, false);
  final Layout<? extends Serializable> layout = getLayout();
  if (layout != null) {
    final byte[] bytes = layout.getFooter();
    if (bytes != null) {
      write(bytes);
    }
  }
  setStopped();
  return true;
}

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

protected void writeFooter(final Layout<?> layout, final OutputStream out) throws IOException {
  final byte[] footer = layout.getFooter();
  if (footer != null) {
    out.write(footer);
  }
}

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

/**
 * Writes the footer.
 */
protected void writeFooter() {
  if (layout == null || skipFooter) {
    return;
  }
  final byte[] footer = layout.getFooter();
  if (footer != null) {
    write(footer);
  }
}

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

@Override
  public DatagramSocketManager createManager(final String name, final FactoryData data) {
    InetAddress inetAddress;
    try {
      inetAddress = InetAddress.getByName(data.host);
    } catch (final UnknownHostException ex) {
      LOGGER.error("Could not find address of " + data.host, ex);
      return null;
    }
    final OutputStream os = new DatagramOutputStream(data.host, data.port, data.layout.getHeader(),
        data.layout.getFooter());
    return new DatagramSocketManager(name, os, inetAddress, data.host, data.port, data.layout, data.bufferSize);
  }
}

相关文章