Debugging Spark applications
In this section, we will see how to debug applications that are running locally (on Eclipse or IntelliJ), standalone or mode in YARN or Mesos. However, before diving deeper, it is necessary to know about logging in the Spark application.
Logging with log4j with Spark recap
We have already this topic in Chapter 14, Time to Put Some Order - Cluster Your Data with Spark MLlib. However, let's replay the same contents to make your brain align with the current discussion Debugging Spark applications. As stated earlier, Spark uses log4j for its own logging. If you configured Spark properly, Spark gets logged all the operation to the shell console. A sample snapshot of the file can be seen from the following figure:

Figure 16: A snap of the log4j.properties file
Set the default spark-shell log level to WARN. When running the spark-shell, the log level for this class is used to overwrite the root logger's log level so that the user can have different defaults for the shell...