org.apache.logging.log4j.core.appender.db.jpa
Class JPAAppender

java.lang.Object
  extended by org.apache.logging.log4j.core.filter.AbstractFilterable
      extended by org.apache.logging.log4j.core.appender.AbstractAppender<LogEvent>
          extended by org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender<JPADatabaseManager>
              extended by org.apache.logging.log4j.core.appender.db.jpa.JPAAppender
All Implemented Interfaces:
Appender<LogEvent>, Filterable, LifeCycle

public final class JPAAppender
extends AbstractDatabaseAppender<JPADatabaseManager>

This Appender writes logging events to a relational database using the Java Persistence API. It requires a pre-configured JPA persistence unit and a concrete implementation of the abstract AbstractLogEventWrapperEntity class decorated with JPA annotations.

See Also:
AbstractLogEventWrapperEntity

Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
LOGGER
 
Method Summary
static JPAAppender createAppender(String name, String suppressExceptions, Filter filter, String bufferSize, String entityClassName, String persistenceUnitName)
          Factory method for creating a JPA appender within the plugin manager.
 String toString()
           
 
Methods inherited from class org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender
append, getLayout, getManager, replaceManager, start, stop
 
Methods inherited from class org.apache.logging.log4j.core.appender.AbstractAppender
error, error, error, getHandler, getName, isExceptionSuppressed, isStarted, parseInt, setHandler
 
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
Overrides:
toString in class AbstractAppender<LogEvent>

createAppender

public static JPAAppender createAppender(String name,
                                         String suppressExceptions,
                                         Filter filter,
                                         String bufferSize,
                                         String entityClassName,
                                         String persistenceUnitName)
Factory method for creating a JPA appender within the plugin manager.

Parameters:
name - The name of the appender.
suppressExceptions - "true" (default) if logging exceptions should be hidden from the application, "false" otherwise.
filter - The filter, if any, to use.
bufferSize - If an integer greater than 0, this causes the appender to buffer log events and flush whenever the buffer reaches this size.
entityClassName - The fully qualified name of the concrete AbstractLogEventWrapperEntity implementation that has JPA annotations mapping it to a database table.
persistenceUnitName - The name of the JPA persistence unit that should be used for persisting log events.
Returns:
a new JPA appender.


Copyright © 1999-2013 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.