title: Get all logs of the current Jenkins build with currentBuild.rawBuild.getLog
body: <p>I want all my jenkins logs of my current build in groovy</p>
  
  <pre><code>env.logs = currentBuild.rawBuild.getLog(1000).join('\n')
  </code></pre>
  
  <p>This works, but the problem here is I have to specify the amount of lines.
  When I use:</p>
  
  <pre><code>env.logs = currentBuild.rawBuild.getLog().join('\n')
  </code></pre>
  
  <p><code>env.logs</code> is empty. What is the right command to get all the logs without specifying the amount of lines. Is this possible?</p>
  
  <p>currentBuild.rawBuild.log seems to work but is <a href="https://stackoverflow.com/questions/37018509/jenkinsfile-build-log">deprecated</a>?</p>