Class AbstractDatabaseAppender<T extends AbstractDatabaseManager>

    • Constructor Detail

      • AbstractDatabaseAppender

        protected AbstractDatabaseAppender​(java.lang.String name,
                                           Filter filter,
                                           boolean ignoreExceptions,
                                           T manager)
        Instantiates the base appender.
        Parameters:
        name - The appender name.
        filter - The filter, if any, to use.
        ignoreExceptions - If true exceptions encountered when appending events are logged; otherwise they are propagated to the caller.
        manager - The matching AbstractDatabaseManager implementation.
    • Method Detail

      • getLayout

        public final Layout<LogEvent> getLayout()
        This always returns null, as database appenders do not use a single layout. The JPA and NoSQL appenders do not use a layout at all. The JDBC appender has a layout-per-column pattern.
        Specified by:
        getLayout in interface Appender
        Overrides:
        getLayout in class AbstractAppender
        Returns:
        null.
      • getManager

        public final T getManager()
        Returns the underlying manager in use within this appender.
        Returns:
        the manager.
      • stop

        public boolean stop​(long timeout,
                            java.util.concurrent.TimeUnit timeUnit)
        Description copied from class: AbstractFilterable
        Cleanup the Filter.
        Specified by:
        stop in interface LifeCycle2
        Overrides:
        stop in class AbstractFilterable
        Parameters:
        timeout - the maximum time to wait
        timeUnit - the time unit of the timeout argument
        Returns:
        true if the receiver was stopped cleanly and normally, false otherwise.
      • append

        public final void append​(LogEvent event)
        Description copied from interface: Appender
        Logs a LogEvent using whatever logic this Appender wishes to use. It is typically recommended to use a bridge pattern not only for the benefits from decoupling an Appender from its implementation, but it is also handy for sharing resources which may require some form of locking.
        Parameters:
        event - The LogEvent.
      • replaceManager

        protected final void replaceManager​(T manager)
        Replaces the underlying manager in use within this appender. This can be useful for manually changing the way log events are written to the database without losing buffered or in-progress events. The existing manager is released only after the new manager has been installed. This method is thread-safe.
        Parameters:
        manager - The new manager to install.