Logs command

The application logs are important for debugging and tuning the performance of an application. The logs can be seen via the command-line interface using following command:

YARN logs -applictationId applicationID

We can also view a specific log file for an application. For example, to view only the error log, we can use following command:

YARN logs -applicationId application_15145363773_001_00 -log_files stderr

The Node Manager can launch multiple containers for a single application and sometimes, due to an error in the data format or application code, a few containers may fail. We have to debug an application at the container level to identify the problems and correct them. The following command can be used to list all the containers for an application ID:

YARN logs -applicationId application_154356768798_0001_001 -show_application_log_info

Once we have the container information available, we can view container logs using the following command:

YARN logs -applicationId application_151345678971_0001_001 -containerId container_151345678652_001_001