org.apache.logging.log4j.web.appender
Class ServletAppender

java.lang.Object
  extended by org.apache.logging.log4j.core.AbstractLifeCycle
      extended by org.apache.logging.log4j.core.filter.AbstractFilterable
          extended by org.apache.logging.log4j.core.appender.AbstractAppender
              extended by org.apache.logging.log4j.web.appender.ServletAppender
All Implemented Interfaces:
Serializable, org.apache.logging.log4j.core.Appender, org.apache.logging.log4j.core.filter.Filterable, org.apache.logging.log4j.core.LifeCycle

@Plugin(name="Servlet",
        category="Core",
        elementType="appender",
        printObject=true)
public class ServletAppender
extends org.apache.logging.log4j.core.appender.AbstractAppender

Logs using the ServletContext's log method

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
org.apache.logging.log4j.core.LifeCycle.State
 
Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
LOGGER
 
Method Summary
 void append(org.apache.logging.log4j.core.LogEvent event)
           
static ServletAppender createAppender(org.apache.logging.log4j.core.Layout<? extends Serializable> layout, org.apache.logging.log4j.core.Filter filter, String name, boolean ignoreExceptions)
          Create a Servlet Appender.
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toString
 
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter, start, stop
 
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.logging.log4j.core.LifeCycle
getState, isStarted, isStopped, start, stop
 

Method Detail

append

public void append(org.apache.logging.log4j.core.LogEvent event)

createAppender

@PluginFactory
public static ServletAppender createAppender(@PluginElement(value="Layout")
                                                           org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
                                                           @PluginElement(value="Filter")
                                                           org.apache.logging.log4j.core.Filter filter,
                                                           @PluginAttribute(value="name")@Required(message="No name provided for ServletAppender")
                                                           String name,
                                                           @PluginAttribute(value="ignoreExceptions",defaultBoolean=true)
                                                           boolean ignoreExceptions)
Create a Servlet Appender.

Parameters:
layout - The layout to use (required). Must extend AbstractStringLayout.
filter - The Filter or null.
name - The name of the Appender (required).
ignoreExceptions - If true (default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.
Returns:
The ServletAppender.


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.