Class BasicTestCallLogger

java.lang.Object
org.apache.juneau.rest.logger.CallLogger
org.apache.juneau.rest.logger.BasicTestCallLogger

public class BasicTestCallLogger extends CallLogger
Default implementation of a CallLogger that only logs REST call errors unless no-log is enabled on the request.

Useful for REST tests where you know that a particular call is going to produce an error response and you don't want that response to be logged producing noisy test output.

Requests can be tagged as no-log (meaning don't log if there's an error) in any of the following ways:

  • A "No-Trace: true" header.
  • A "noTrace=true" query parameter.
  • A "NoTrace" request attribute with a string value of "true".
Configured Settings:
  • Logs to the context logger.
  • Only calls with status code >=400 will be logged.
  • Logs full request and response entity.
See Also:
  • Constructor Details

    • BasicTestCallLogger

      public BasicTestCallLogger(BeanStore beanStore)
      Constructor.
      Parameters:
      beanStore - The bean store containing injectable beans for this logger.
  • Method Details

    • init

      protected CallLogger.Builder init(BeanStore beanStore)
      Description copied from class: CallLogger
      Initializer.

      Subclasses should override this method to make modifications to the builder used to create this logger.

      Overrides:
      init in class CallLogger
      Parameters:
      beanStore - The bean store containing injectable beans for this logger.
      Returns:
      A new builder object.