How to write logger info to s3 bucket from AWS GLUE job

Viewed 1023

I have a small script, which will save the logger info in the local file system

but I'm planning to run this file in AWS Glue, and want to save the log in the s3 bucket, I gave the path, the program is running successfully but the file is not saving in S3

import logging, pandas as pd
import boto3


s3 = boto3.client('s3')


#logging configuration
#logging levels are INFO,Debug,Error,WARN,FATAL



logging.basicConfig(filename='<bucketname>/spark.logs',level=logging.INFO)

#spark = createSparkDriver()
logging.info('Spark driver created sucessfully {}'.format('SUCCESS'))

logging.info('source_df printSchema')

print('DoneSUCCESS')

Can you anyone help me

0 Answers
Related