How do I log from my Python Spark script

前端 未结 6 1349
南旧
南旧 2020-11-30 01:51

I have a Python Spark program which I run with spark-submit. I want to put logging statements in it.

logging.info(\"This is an informative messa         


        
6条回答
  •  再見小時候
    2020-11-30 02:07

    import logging
    
    # Logger
    
    logging.basicConfig(format='%(asctime)s %(filename)s %(funcName)s %(lineno)d %(message)s')
    logger = logging.getLogger('driver_logger')
    logger.setLevel(logging.DEBUG)
    

    Simplest way to log from pyspark !

提交回复
热议问题