Class LogControl

java.lang.Object
org.apache.hadoop.fs.s3a.impl.logging.LogControl

public abstract class LogControl extends Object
class to assist reflection-based control of logger back ends.

An instance of LogControl is able to control the log levels of loggers for log libraries such as Log4j, yet can be created in code designed to support multiple back end loggers behind SLF4J.

  • Constructor Details

    • LogControl

      public LogControl()
  • Method Details

    • setLogLevel

      public final boolean setLogLevel(String log, LogControl.LogLevel level)
      Sets a log level for a class/package.
      Parameters:
      log - log to set
      level - level to set
      Returns:
      true if the log was set
    • setLevel

      protected abstract boolean setLevel(String log, LogControl.LogLevel level) throws Exception
      Sets a log level for a class/package. Exceptions may be raised; they will be caught in setLogLevel(String, LogLevel) and ignored.
      Parameters:
      log - log to set
      level - level to set
      Returns:
      true if the log was set
      Throws:
      Exception - any problem loading/updating the log