Class LogAdjuster


  • public class LogAdjuster
    extends Object
    Adjusts and resets log levels of the system. Definitely isn't thread-safe.
    • Constructor Detail

      • LogAdjuster

        public LogAdjuster​(String baseUrl)
        Requires the base url of the server in order to log in a ConfluenceRpc.
    • Method Detail

      • setLogLevel

        public void setLogLevel​(String logger,
                                LoggingAndProfiling.LogLevel level)
        Adjust the log level for a given logger pattern. It will be reset by a subsequent call to resetLogLevels(), which should be called in a finally or a tearDown.
        Since:
        7.5
      • setLogLevel

        @Deprecated
        public void setLogLevel​(String logger,
                                org.apache.log4j.Level level)
        Deprecated.
        Adjust the log level for a given logger pattern. It will be reset by a subsequent call to resetLogLevels(), which should be called in a finally or a tearDown.
      • suppressMultipartRequestLogging

        public void suppressMultipartRequestLogging()
        Convenience method to change logging of the org.apache.struts2.dispatcher.multipart.MultiPartRequest to LoggingAndProfiling.LogLevel.ERROR, which is very commonly performed to suppress its noisy logging. This call should be matched with a call to resetLogLevels() in the finally or tearDown.
      • resetLogLevels

        public void resetLogLevels()
        Undoes all level setting by this LogAdjuster. Clears its state, so a new LogAdjuster is not required each time.