How do I write messages to the output log on AWS Glue?

后端 未结 5 807
小鲜肉
小鲜肉 2021-02-05 06:00

AWS Glue jobs log output and errors to two different CloudWatch logs, /aws-glue/jobs/error and /aws-glue/jobs/output by default. When I include p

5条回答
  •  半阙折子戏
    2021-02-05 06:46

    I noticed the above answers are written in python. For Scala you could do the following

    import com.amazonaws.services.glue.log.GlueLogger
    
    object GlueApp {
      def main(sysArgs: Array[String]) {
        val logger = new GlueLogger
        logger.info("info message")
        logger.warn("warn message")
        logger.error("error message")
      }
    }
    
    

    You can find both Python and Scala solution from official doc here

提交回复
热议问题