在哪里可以找到databricks中的自定义日志记录?

dgiusagp  于 2021-05-17  发布在  Spark
关注(0)|答案(0)|浏览(353)

我正在为spark/databricks中运行的数据转换开发一些自定义逻辑。我希望生成自定义日志条目来跟踪生产集群上的一些意外行为。创建下面的简单帮助程序后,日志在本地环境中可见(intellij使用winutil.exe)。我希望日志条目在databricks的 log4j-active ,但它没有显示在那里。我在哪里可以找到定制日志?是否需要请求一些配置更改?
用于日志记录的帮助程序代码:object helper{//…这里有一堆其他的帮助程序函数。。

def ocrLogger(message : String): Unit ={
    val logger : Logger = LoggerFactory.getLogger(getClass.getName)
    if(logger.isInfoEnabled) logger.info(message)
  }
}

调用帮助程序的代码示例:

helper.ocrLogger(this.poliKey + " initial CNBR estimate: " + estimatedCnbrLC)

日志条目在本地环境中的显示方式(第3行):

20/11/17 14:14:07 INFO ShuffleBlockFetcherIterator: Started 0 remote fetches in 1 ms
20/11/17 14:14:07 INFO SQLHadoopMapReduceCommitProtocol: Using output committer class org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
20/11/17 14:14:07 INFO helper$: 83539323 initial CNBR estimate: 1.1966976E7
20/11/17 14:14:07 INFO FileOutputCommitter: Saved output of task 'attempt_20201117141407_0010_m_000001_0' to wasb:/user/current/Out_BookingPoliEstimate/_temporary/0/task_20201117141407_0010_m_000001
20/11/17 14:14:07 INFO SparkHadoopMapRedUtil: attempt_20201117141407_0010_m_000001_0: Committed

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题