Are you sure you're running Spark in client mode and not in cluster mode? If it's cluster mode, the executors might not have access to the log4j2.properties file located on your local C://