Class NTEventLogAppender

java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.nt.NTEventLogAppender
All Implemented Interfaces:
Appender, OptionHandler

public class NTEventLogAppender extends AppenderSkeleton
Append to the NT event log system.

WARNING This appender can only be installed and used on a Windows system.

Do not forget to place NTEventLogAppender.dll, NTEventLogAppender.amd64.dll, NTEventLogAppender.ia64.dll or NTEventLogAppender.x86.dll as appropriate in a directory that is on the PATH of the Windows system. Otherwise, you will get a java.lang.UnsatisfiedLinkError.

Author:
Chris Taylor, Jim Cakalic
  • Constructor Details

    • NTEventLogAppender

      public NTEventLogAppender()
    • NTEventLogAppender

      public NTEventLogAppender(String source)
    • NTEventLogAppender

      public NTEventLogAppender(String server, String source)
    • NTEventLogAppender

      public NTEventLogAppender(Layout layout)
    • NTEventLogAppender

      public NTEventLogAppender(String source, Layout layout)
    • NTEventLogAppender

      public NTEventLogAppender(String server, String source, Layout layout)
  • Method Details

    • close

      public void close()
      Description copied from interface: Appender
      Release any resources allocated within the appender such as file handles, network connections, etc.

      It is a programming error to append to a closed appender.

    • activateOptions

      public void activateOptions()
      Description copied from class: AppenderSkeleton
      Derived appenders should override this method if option structure requires it.
      Specified by:
      activateOptions in interface OptionHandler
      Overrides:
      activateOptions in class AppenderSkeleton
    • append

      public void append(LoggingEvent event)
      Description copied from class: AppenderSkeleton
      Subclasses of AppenderSkeleton should implement this method to perform actual logging. See also AppenderSkeleton.doAppend method.
      Specified by:
      append in class AppenderSkeleton
    • finalize

      public void finalize()
      Description copied from class: AppenderSkeleton
      Finalize this appender by calling the derived class' close method.
      Overrides:
      finalize in class AppenderSkeleton
    • setSource

      public void setSource(String source)
      The Source option which names the source of the event. The current value of this constant is Source.
    • getSource

      public String getSource()
    • requiresLayout

      public boolean requiresLayout()
      The NTEventLogAppender requires a layout. Hence, this method always returns true.