Class LogCtlLog4j2

java.lang.Object
org.apache.jena.atlas.logging.LogCtlLog4j2

public class LogCtlLog4j2 extends Object
Additional logging control, for Log4j2 as used by jena-cmds.

This class depends on log4j2-api and also log4j2-core. These are <optional> dependencies for Jena which can use any slf4j provider.

This class is split out from LogCtl to decouple the dependencies.

This class is not used if log4j2 is not used.

  • Field Details

    • log4j2setup

      public static String log4j2setup
      Default log4j2 setup
  • Constructor Details

    • LogCtlLog4j2

      public LogCtlLog4j2()
  • Method Details

    • resetLogging

      public static void resetLogging(String configString)
      Reset logging for log4j2. The string is log4j2.properties format.
    • resetLogging

      public static void resetLogging(InputStream inputStream, String resourceName)
      Reset logging for log4j2 from a string. The resourceName is used to determine the syntax.
    • resetLogging

      public static void resetLogging(InputStream inputStream, LogCtlLog4j2.SyntaxHint syntaxHint)
      Reset logging for log4j2 from an InputStream with the given syntax.
    • reconfigureLog4j2fromFile

      public static void reconfigureLog4j2fromFile(String filename)
      Reconfigure log4j2 from a file.

      The file syntax is determined by the file extension (".properties" or ".xml").

      Existing loggers are reconfigured by this function.

    • reconfigureLog4j2fromFile

      public static void reconfigureLog4j2fromFile(String filename, LogCtlLog4j2.SyntaxHint syntaxHint)
      Reconfigure log4j2 from a file.

      The file syntax is determined by the syntax hint.

      Existing loggers are reconfigured by this function.

    • reconfigureLog4j2fromString

      public static void reconfigureLog4j2fromString(String configString, LogCtlLog4j2.SyntaxHint syntaxHint)
      Reconfigure log4j2 from a string.

      The syntax is given by the syntax hint.

      Existing loggers are reconfigured by this function.