Java – Why did java action System.out disappear when executed in Oozie?

Why did java action System.out disappear when executed in Oozie?… here is a solution to the problem.

Why did java action System.out disappear when executed in Oozie?

I’m using an oozie environment. After successfully completing the job, I can’t find the System.out.println output in the oozie logs. I googled for hours and found it this

But there was no result. From the oozie web console I got the job ID “0000011-180801114827014-oozie-oozi-W” and then I tried to get more information about the job using the following command:

oozie job -oozie http://localhost:11000/oozie/ -info 0000011-180801114827014-oozie-oozi-W

enter image description here

Then I get the externalId from the JobCompleted16546″ operation, which I consider 180801114827014 job. Finally, I tried to get logs from java operations using the following command:

yarn logs -applicationId application_180801114827014_16546
enter image description here

Where did I do it wrong? Any suggestions?

Edit

I checked if log aggregation is enabled and it seems to be enabled
enter image description here

So, what am I doing wrong?

Solution

As a rule of thumb, I can say that stdout is not removed from any YARN operations, however, the encouragement to log information in your application is to use Log4j, which goes to syslog, not stdout (or stderr).

However, as your terminal says, YARN log aggregation needs to be enabled/completed before you can view logs from the yarn logs command

If the command doesn’t work otherwise, go to the Oozie UI, go to Job Actions, or go directly to the YARN UI and search for the action, and from there find the log link

Related Problems and Solutions