Class Log4j2LogEventUtil

java.lang.Object
nl.pim16aap2.util.logging.floggerbackend.Log4j2LogEventUtil

public final class Log4j2LogEventUtil extends Object
Helper to format LogData.

Note: Any changes in this code should, as far as possible, be reflected in the equivalently named log4j implementation. If the behaviour of this class starts to deviate from that of the log4j backend in any significant way, this difference should be called out clearly in the documentation.

This class was modified to add more log levels than the default ones. The levels used by FLogger do not all exist in Log4j2, so we added them ourselves. This allows us to more finely control logging. Previously, AbstractLogger.atFinest() and AbstractLogger.atFiner() would both log at the same level and so would AbstractLogger.atFine() and AbstractLogger.atConfig(). Now, all four methods log at different levels.

Specifically, the following levels were added:

  • Method Details

    • toLog4jLevel

      public static org.apache.logging.log4j.Level toLog4jLevel(Level level)
      Converts java.util.logging.Level to org.apache.log4j.Level.

      This method was modified to add more log levels than the default ones. CustomLevel.FINER and CustomLevel.CONF were added. More information can be found in the documentation of this class.