ContainerLogAppender (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn, class: ContainerLogAppender

Package org.apache.hadoop.yarn

# Class ContainerLogAppender

java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.WriterAppender
org.apache.log4j.FileAppender
org.apache.hadoop.yarn.ContainerLogAppender

All Implemented Interfaces:
  `Flushable`, `org.apache.log4j.Appender`, `org.apache.log4j.spi.OptionHandler`

@Public @Unstable public class ContainerLogAppender extends org.apache.log4j.FileAppender implements Flushable
A simple log4j-appender for container's logs.

- ## Field Summary

  ### Fields inherited from class org.apache.log4j.FileAppender

  `bufferedIO, bufferSize, fileAppend, fileName`

  ### Fields inherited from class org.apache.log4j.WriterAppender

  `encoding, immediateFlush, qw`

  ### Fields inherited from class org.apache.log4j.AppenderSkeleton

  `errorHandler, headFilter, layout, name, tailFilter, threshold`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContainerLogAppender()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `activateOptions()`
  `void`
  `append(org.apache.log4j.spi.LoggingEvent event)`
  `void`
  `close()`
  `void`
  `flush()`
  `String`
  `getContainerLogDir()`
  Getter/Setter methods for log4j.
  `String`
  `getContainerLogFile()`
  `long`
  `getTotalLogFileSize()`
  `void`
  `setContainerLogDir(String containerLogDir)`
  `void`
  `setContainerLogFile(String containerLogFile)`
  `void`
  `setTotalLogFileSize(long logSize)`
  Setter so that log4j can configure it from the configuration(log4j.properties).

  ### Methods inherited from class org.apache.log4j.FileAppender

  `closeFile, getAppend, getBufferedIO, getBufferSize, getFile, reset, setAppend, setBufferedIO, setBufferSize, setFile, setFile, setQWForFiles`

  ### Methods inherited from class org.apache.log4j.WriterAppender

  `checkEntryConditions, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter, shouldFlush, subAppend, writeFooter, writeHeader`

  ### Methods inherited from class org.apache.log4j.AppenderSkeleton

  `addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold`

  ### Methods inherited from class java.lang.Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ContainerLogAppender

    public ContainerLogAppender()

- ## Method Details

  - ### activateOptions

    public void activateOptions()
    Specified by:
      `activateOptions` in interface `org.apache.log4j.spi.OptionHandler`
    Overrides:
      `activateOptions` in class `org.apache.log4j.FileAppender`

  - ### append

    public void append(org.apache.log4j.spi.LoggingEvent event)
    Overrides:
      `append` in class `org.apache.log4j.WriterAppender`

  - ### flush

    public void flush()
    Specified by:
      `flush` in interface `Flushable`

  - ### close

    public void close()
    Specified by:
      `close` in interface `org.apache.log4j.Appender`
    Overrides:
      `close` in class `org.apache.log4j.WriterAppender`

  - ### getContainerLogDir

    public String getContainerLogDir()
    Getter/Setter methods for log4j.
    Returns:
      containerLogDir.

  - ### setContainerLogDir

    public void setContainerLogDir(String containerLogDir)

  - ### getContainerLogFile

    public String getContainerLogFile()

  - ### setContainerLogFile

    public void setContainerLogFile(String containerLogFile)

  - ### getTotalLogFileSize

    public long getTotalLogFileSize()

  - ### setTotalLogFileSize

    public void setTotalLogFileSize(long logSize)
    Setter so that log4j can configure it from the configuration(log4j.properties).
    Parameters:
      `logSize` - log size.