2. Including and Excluding Log Files in YARN Applications Running on Slider

For YARN applications running on Slider, log aggregation is specified in the global section of the resources.json: configuration file:

"global": { "yarn.log.include.patterns": "", "yarn.log.exclude.patterns": ""
 },

If yarn.log.include.patterns is empty, all container logs are included. You can specify the name(s) of log files (for example, agent.log) that you do not want to aggregate using yarn.log.exclude.patterns.

For example, the following resources.json property settings will aggregate all logs beginning with "std", but exclude the stderr log.

"global": { "yarn.log.include.patterns": "std*", "yarn.log.exclude.patterns": "stderr"
 },

The aggregated logs are stored in the HDFS /app-logs/ directory. The following command can be used to retrieve the logs: yarn logs -applicationId <app_id>

[Note]Note

For applications deployed directly on YARN, you can use LogAggregationContext inside ApplicationSubmissionContext to specify the include and exclude patterns.


loading table of contents...