Class Log4J2Configurator

java.lang.Object
nl.pim16aap2.util.logging.Log4J2Configurator

public final class Log4J2Configurator extends Object
Configures Log4J2 to log to a file at the specified path.

Only logs messages from the package nl.pim16aap2.

This class is a singleton. Use getInstance() to get the instance.

  • Method Details

    • getInstance

      public static Log4J2Configurator getInstance()
      Gets the instance of the Log4J2Configurator.
      Returns:
      The instance of the Log4J2Configurator.
    • setLevel

      public void setLevel(org.apache.logging.log4j.Level level)
      Sets the level to filter on.

      Any log event with a level lower than this level will be filtered out.

      Parameters:
      level - The level to filter on.
    • setJULLevel

      public void setJULLevel(Level level)
      Sets the level to filter on.

      Any log event with a level lower than this level will be filtered out.

      Parameters:
      level - The level to filter on.
    • setLogPath

      public void setLogPath(Path path)
      Sets the path to log to.

      This method will create a new appender and logger for the specified path.

      Parameters:
      path - The path to log to.