Class RuntimeLogSink

java.lang.Object
com.google.apphosting.runtime.RuntimeLogSink

public class RuntimeLogSink extends Object
RuntimeLogSink attaches a root Handler that records all log messages Level.INFO or higher as a RuntimePb.UPResponse.RuntimeLogLine attached to the current RuntimePb.UPResponse.

TODO: This class is designed to be used in a single-threaded runtime. If multiple requests are executing in a single process in parallel, their messages will currently overlap. If we want to support this configuration in the future we should do something slightly smarter here (however, we don't want to limit logs to only the thread serving the request).

  • Constructor Details

    • RuntimeLogSink

      public RuntimeLogSink(long maxSizeBytes)
  • Method Details

    • addHandlerToRootLogger

      public void addHandlerToRootLogger()
    • flushLogs

      public void flushLogs(MutableUpResponse response)