Log4j 1.1b7

org.apache.log4j.nt
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 the file NTEventLogAppender.dll 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

Field Summary
static String SOURCE_OPTION
          Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold, THRESHOLD_OPTION
 
Constructor Summary
NTEventLogAppender()
           
NTEventLogAppender(Layout layout)
           
NTEventLogAppender(String source)
           
NTEventLogAppender(String source, Layout layout)
           
NTEventLogAppender(String server, String source)
           
NTEventLogAppender(String server, String source, Layout layout)
           
 
Method Summary
 void activateOptions()
          Derived appenders should override this method if option structure requires it.
 void append(LoggingEvent event)
          Subclasses of AppenderSkeleton should imlement this method to perform actual logging.
 void close()
          Release any resources allocated within the appender such as file handles, network connections, etc.
 void finalize()
          Finalize this appender by calling the imlenentation's close method.
 String[] getOptionStrings()
          Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.
 String getSource()
           
 boolean requiresLayout()
          The NTEventLogAppender requires a layout.
 void setOption(String key, String value)
          Set option to value.
 void setSource(String source)
          The Source option which names the source of the event.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_OPTION

public static final String SOURCE_OPTION
Deprecated. Options are now handled using the JavaBeans paradigm. This constant is not longer needed and will be removed in the near term.

The string constant used in naming the source of the event. The current value of this constant is Source.
Constructor Detail

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 Detail

getOptionStrings

public String[] getOptionStrings()
Deprecated. We now use JavaBeans introspection to configure components. Options strings are no longer needed.

Returns the option names for this component.
Overrides:
getOptionStrings in class AppenderSkeleton

setOption

public void setOption(String key,
                      String value)
Deprecated. Use the setter method for the option directly instead of the generic setOption method.

Description copied from interface: OptionHandler
Set option to value.

The handling of each option depends on the OptionHandler instance. Some options may become active immediately whereas other may be activated only when OptionHandler.activateOptions() is called.

Overrides:
setOption in class AppenderSkeleton

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.
Overrides:
activateOptions in class AppenderSkeleton

append

public void append(LoggingEvent event)
Description copied from class: AppenderSkeleton
Subclasses of AppenderSkeleton should imlement this method to perform actual logging. See also AppenderSkeleton.doAppend method.
Overrides:
append in class AppenderSkeleton

finalize

public void finalize()
Description copied from class: AppenderSkeleton
Finalize this appender by calling the imlenentation's 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.

Log4j 1.1b7

Please notify me about new log4j releases.