Class SimulationThresholdFilter

java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilter
fr.ifremer.isisfish.logging.SimulationThresholdFilter
All Implemented Interfaces:
org.apache.logging.log4j.core.Filter, org.apache.logging.log4j.core.LifeCycle, org.apache.logging.log4j.core.LifeCycle2

@Plugin(name="SimulationThresholdFilter", category="Core", elementType="filter", printObject=true) public final class SimulationThresholdFilter extends org.apache.logging.log4j.core.filter.AbstractFilter
Filter always available in log4j configuration that filter simulation log depending of simulation log level configuration.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.logging.log4j.core.filter.AbstractFilter

    org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder<B extends org.apache.logging.log4j.core.filter.AbstractFilter.AbstractFilterBuilder<B>>

    Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter

    org.apache.logging.log4j.core.Filter.Result

    Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle

    org.apache.logging.log4j.core.LifeCycle.State
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    fr.ifremer.isisfish package log level.
    static final String
    Simulation id.
    static final String
    org.nuiton package log level.
    static final String
    Simulation log file for lof4j file appender (only if simulationId is defined)
    static final String
    Script log level.

    Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter

    onMatch, onMismatch

    Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

    DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER

    Fields inherited from interface org.apache.logging.log4j.core.Filter

    ELEMENT_TYPE, EMPTY_ARRAY
  • Method Summary

    Modifier and Type
    Method
    Description
    createFilter(org.apache.logging.log4j.Level defaultThreshold, org.apache.logging.log4j.core.Filter.Result onMatch, org.apache.logging.log4j.core.Filter.Result onMismatch)
    Create the DynamicThresholdFilter.
    org.apache.logging.log4j.core.Filter.Result
    filter(org.apache.logging.log4j.core.LogEvent event)
     
    org.apache.logging.log4j.core.Filter.Result
    filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, Object msg, Throwable t)
     
    org.apache.logging.log4j.core.Filter.Result
    filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object... params)
     
    org.apache.logging.log4j.core.Filter.Result
    filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, org.apache.logging.log4j.message.Message msg, Throwable t)
     

    Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter

    equalsImpl, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, getOnMatch, getOnMismatch, hashCodeImpl, toString

    Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

    getState, getStatusLogger, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stop, stop

    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.Filter

    filter

    Methods inherited from interface org.apache.logging.log4j.core.LifeCycle

    getState, initialize, isStarted, isStopped, start, stop
  • Field Details

    • SIMULATION_ID

      public static final String SIMULATION_ID
      Simulation id. Present in MDC context only if a simulation is running.
      See Also:
    • SIMULATION_LOG_FILE

      public static final String SIMULATION_LOG_FILE
      Simulation log file for lof4j file appender (only if simulationId is defined)
      See Also:
    • SIMULATION_APPLICATION_LEVEL

      public static final String SIMULATION_APPLICATION_LEVEL
      fr.ifremer.isisfish package log level.
      See Also:
    • SIMULATION_LIB_LEVEL

      public static final String SIMULATION_LIB_LEVEL
      org.nuiton package log level.
      See Also:
    • SIMULATION_SCRIPT_LEVEL

      public static final String SIMULATION_SCRIPT_LEVEL
      Script log level.
      See Also:
  • Method Details

    • filter

      public org.apache.logging.log4j.core.Filter.Result filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, String msg, Object... params)
      Specified by:
      filter in interface org.apache.logging.log4j.core.Filter
      Overrides:
      filter in class org.apache.logging.log4j.core.filter.AbstractFilter
    • filter

      public org.apache.logging.log4j.core.Filter.Result filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, Object msg, Throwable t)
      Specified by:
      filter in interface org.apache.logging.log4j.core.Filter
      Overrides:
      filter in class org.apache.logging.log4j.core.filter.AbstractFilter
    • filter

      public org.apache.logging.log4j.core.Filter.Result filter(org.apache.logging.log4j.core.Logger logger, org.apache.logging.log4j.Level level, org.apache.logging.log4j.Marker marker, org.apache.logging.log4j.message.Message msg, Throwable t)
      Specified by:
      filter in interface org.apache.logging.log4j.core.Filter
      Overrides:
      filter in class org.apache.logging.log4j.core.filter.AbstractFilter
    • filter

      public org.apache.logging.log4j.core.Filter.Result filter(org.apache.logging.log4j.core.LogEvent event)
      Specified by:
      filter in interface org.apache.logging.log4j.core.Filter
      Overrides:
      filter in class org.apache.logging.log4j.core.filter.AbstractFilter
    • createFilter

      @PluginFactory public static SimulationThresholdFilter createFilter(@PluginAttribute("defaultThreshold") org.apache.logging.log4j.Level defaultThreshold, @PluginAttribute("onMatch") org.apache.logging.log4j.core.Filter.Result onMatch, @PluginAttribute("onMismatch") org.apache.logging.log4j.core.Filter.Result onMismatch)
      Create the DynamicThresholdFilter.
      Parameters:
      defaultThreshold - The default Level.
      onMatch - The action to perform if a match occurs.
      onMismatch - The action to perform if no match occurs.
      Returns:
      The DynamicThresholdFilter.