I did follow this existing stackoverflow link, though that the accepted answer works if Spark has been installed from the source.
However, I installed pyspark
via pip
as a result I am unable to locate the conf/log4j.properties.template
in order to mute the logging info.
I am using the following alternate solution from the same link:
def quiet_logs( sc ):
logger = sc._jvm.org.apache.log4j
logger.LogManager.getLogger("org"). setLevel( logger.Level.ERROR )
logger.LogManager.getLogger("akka").setLevel( logger.Level.ERROR )
The above solution still allows the logs from the start-up and closing down Spark info on the terminal, which does not happen if I am able to update conf/log4j.properties.template
.
Any suggestions will be appreciated.