Redirecting System.out and System.err files

In some cases, we may want to integrate into our BPEL processes other components or applications that print their log information either to standard output, standard error, or both. This recipe will show you how to redirect those outputs to the logfile in order to have logging information in one place.

Getting ready…

To complete the recipe, we will amend the BPEL process from the Logging exceptions recipe. Since the main flow of the BPEL process already throws an exception, we will continue explaining this recipe at the fault handler branch of the BPEL process.

How to do it…

In order to redirect the System.out and System.err streams, we create two additional classes in the project:

  1. The LogStream class extends ...

Get BPEL and Java Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.