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

后端 未结 5 808
小鲜肉
小鲜肉 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:26

    I know the article is not new but maybe it could be helpful for someone: For me logging in glue works with the following lines of code:

    # create glue context
    glueContext = GlueContext(sc)
    # set custom logging on
    logger = glueContext.get_logger()
    ...
    #write into the log file with:
    logger.info("s3_key:" + your_value)
    

提交回复
热议问题