Class FilterWrapper


  • public class FilterWrapper
    extends Filter
    This acts as a container for Log4j 2 Filters to be attached to Log4j 1 components. However, the Log4j 2 Filters will always be called directly so this class just acts as a container.
    • Field Detail

      • filter

        private final Filter filter
    • Constructor Detail

      • FilterWrapper

        public FilterWrapper​(Filter filter)
    • Method Detail

      • adapt

        public static Filter adapt​(Filter filter)
        Adapts a Log4j 2.x filter into a Log4j 1.x filter. Applying this method to the result of FilterAdapter.adapt(Filter) should return the original Log4j 1.x filter.
        Parameters:
        filter - a Log4j 2.x filter
        Returns:
        a Log4j 1.x filter or null if the parameter is null
      • getFilter

        public Filter getFilter()
      • decide

        public int decide​(LoggingEvent event)
        This method is never called.
        Specified by:
        decide in class Filter
        Parameters:
        event - The LoggingEvent to decide upon.
        Returns:
        0