Logger#

Classes#

PySparkLogger([name])

Custom logging.Logger wrapper for PySpark that logs messages in a structured JSON format.

Methods#

PySparkLogger.getLogger([name])

Return a PySparkLogger with the specified name, creating it if necessary.

PySparkLogger.addHandler(handler)

Add the specified handler to this logger in structured JSON format.

PySparkLogger.info(msg, *args, **kwargs)

Log 'msg % args' with severity 'INFO' in structured JSON format.

PySparkLogger.warning(msg, *args, **kwargs)

Log 'msg % args' with severity 'WARNING' in structured JSON format.

PySparkLogger.error(msg, *args, **kwargs)

Log 'msg % args' with severity 'ERROR' in structured JSON format.

PySparkLogger.exception(msg, *args, **kwargs)

Convenience method for logging an ERROR with exception information.