設置自定義日誌消息在Scala中:
% scala org.slf4j進口。{記錄器,LoggerFactory} val customlog = LoggerFactory.getLogger (customlog) customLogs.info customlog(“測試信息日誌”)。警告customlog(“測試警告日誌”)。錯誤(“測試錯誤日誌”)打印(“這消息將在stdout而不是log4j”)
在Python中設置自定義日誌消息
% python log4jLogger = spark.sparkContext._jvm.org.apache.log4j customlog = log4jLogger.LogManager.getLogger (customlog) customLogs.info customlog(“測試信息日誌”)。警告customlog(“測試警告日誌”)。錯誤(“測試錯誤日誌”)打印(“這消息將在stdout而不是log4j”)
設置自定義日誌消息在Scala中:
% scala org.slf4j進口。{記錄器,LoggerFactory} val customlog = LoggerFactory.getLogger (customlog) customLogs.info customlog(“測試信息日誌”)。警告customlog(“測試警告日誌”)。錯誤(“測試錯誤日誌”)打印(“這消息將在stdout而不是log4j”)
在Python中設置自定義日誌消息
% python log4jLogger = spark.sparkContext._jvm.org.apache.log4j customlog = log4jLogger.LogManager.getLogger (customlog) customLogs.info customlog(“測試信息日誌”)。警告customlog(“測試警告日誌”)。錯誤(“測試錯誤日誌”)打印(“這消息將在stdout而不是log4j”)