In order to get logs through command, you have got 2 ways:
1. If log aggregation is turned on (with the yarn.log-aggregation-enable yarn-site.xml) then do this:
yarn logs -applicationId <app ID>
2. However, if this is not turned on then one needs to go on the Data-Node machine and look at
$HADOOP_HOME/logs/userlogs/application_1474886780074_XXXX/
There you will find stdin stderr stdout
application_1474886780074_XXXX is the application id