Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40753

Java client cannot stream logs

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • java-client-api
    • None

      Definition of the problem

      Currently java client can retrieve only full html and text log. Jenkins API is more rich and offers way to skip number of the first characters in the log. This approach can be used to query Jenkins periodically to receive log updates. We can easily modify java client to provide alternative method that would allow us to retrieve logs by chunks (partially).

      Suggested approach

      > Fetching logs asynchronously.

      BuildWithDetails build=...
      build.poolLogs(new LogUpdateListener(){
        function String onData(){...}
        function String onFinish(){..}
      }
      

      > Fetching logs with markers and additional metadata.

      BuildWithDetails build=...
      LogDetails details = build.fetchLogs(...)
      details.finished()
      details.delta(); // delivers delta
      

      > Fetching with specifying limit

      BuildWithDetails build=...
      LogDetails details = build.fetchLogs(0,1000) //  start and offset
      

      Solutions

      All methods implemented in pull request:
      https://github.com/jenkinsci/java-client-api/issues/217

      Migrated from GitHub issue: https://github.com/jenkinsci/java-client-api/issues/217

            wtrocki Wojciech Trocki
            wtrocki Wojciech Trocki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: