You might not get everything, see 
https://issues.jenkins-ci.org/browse/JENKINS-32191 
<https://issues.jenkins-ci.org/browse/JENKINS-32191>.

I’m calling sleep in the warnings recorder step for 5 seconds to avoid the 
problem, this hack works quite well.

You can obtain the log for the individual stages by following Jesse’s 
instructions in 
https://issues.jenkins-ci.org/browse/JENKINS-32191?focusedCommentId=362160&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-362160
 
<https://issues.jenkins-ci.org/browse/JENKINS-32191?focusedCommentId=362160&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-362160>


> Am 13.04.2019 um 21:27 schrieb Daniel Anechitoaie <[email protected]>:
> 
> I'm writing a pipeline Step plugin and in case build fails for any reason I 
> need to publish the build log somewhere.
> So I'm thinking of using "Run.getLog(nr)".
> 
> Any idea if I'll have problems with the log buffering/net being flushed when 
> the build fails?
> 
> The way the plugin is going to be used is something like this:
> 
> node {
>     try {
>         stage('Something 1') {
>         
>         }
> 
>         stage('Something 2') {
>         
>         }
> 
>         stage('Something 3') {
>         
>         }
>     } catch (e) {
>         myPlugin()
>         throw e
>     }
> }
> 
> 
> So if any of the stages fail, when I call myPlugin() in "catch" if inside my 
> plugin I call  "Run.getLog(nr)" will I get the full log (of what happened up 
> to that point)? Or it's possible I'll get partial log in some cases due 
> caching/buffering?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/5c9aeda8-4d0a-4d02-8035-43eef22be8ee%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-dev/5c9aeda8-4d0a-4d02-8035-43eef22be8ee%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/60C8A444-D7CC-4513-9B12-A3F3B63CB938%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to