I'm using Spark-2.4 and I'm trying to access the log4j logger from within a PandasUDF function The way it can be done on the driver:
sc = SparkContext(conf=conf)
log4jLogger = sc._jvm.org.apache.log4j
log = log4jLogger.LogManager.getLogger(__name__)
log.warn("Hello World!")
Can someone please post an example?