Package nl.pim16aap2.util.logging
Class Log4J2Configurator
java.lang.Object
nl.pim16aap2.util.logging.Log4J2Configurator
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 Summary
Modifier and TypeMethodDescriptionstatic Log4J2ConfiguratorGets the instance of the Log4J2Configurator.voidsetJULLevel(Level level) Sets the level to filter on.voidsetLevel(org.apache.logging.log4j.Level level) Sets the level to filter on.voidsetLogPath(Path path) Sets the path to log to.
-
Method Details
-
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
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
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.
-