Class ChunkedLoggingStreamTestUtils

java.lang.Object
org.elasticsearch.common.logging.ChunkedLoggingStreamTestUtils

public class ChunkedLoggingStreamTestUtils extends Object
Utility for capturing and decoding the data logged by a ChunkedLoggingStream.
  • Method Details

    • getDecodedLoggedBody

      public static BytesReference getDecodedLoggedBody(org.apache.logging.log4j.Logger captureLogger, org.apache.logging.log4j.Level level, String prefix, ReferenceDocs referenceDocs, org.elasticsearch.core.CheckedRunnable<Exception> runnable)
      Test utility function which captures the logged output from a ChunkedLoggingStream, combines the chunks, Base64-decodes it and Gzip-decompresses it to retrieve the original data.
      Parameters:
      captureLogger - The logger whose output should be captured.
      level - The log level for the data.
      prefix - The prefix used by the logging stream.
      referenceDocs - A link to the reference docs about the output.
      runnable - The action which emits the logs.
      Returns:
      A BytesReference containing the captured data.