omrikiei / aws_logging_handlers

AWS integration for python logging handlers(S3, Kinesis)
https://omrikiei.github.io/aws_logging_handlers/
MIT License
71 stars 27 forks source link

S3Handler example Error self.uploader = self.object.initiate_multipart_upload(**encryption) TypeError: initiate_multipart_upload() argument after ** must be a mapping, not NoneType #27

Open linlin994395 opened 3 years ago

linlin994395 commented 3 years ago

`import logging from aws_logging_handlers.S3 import S3Handler from aws_logging_handlers.Kinesis import KinesisHandler

bucket = "services-s3-log"

s3_handler = S3Handler("test_log/log.log", bucket, workers=1) formatter = logging.Formatter('[%(asctime)s] %(filename)s:%(lineno)d} %(levelname)s - %(message)s') s3_handler.setFormatter(formatter) logger = logging.getLogger('root') logger.setLevel(logging.INFO) logger.addHandler(s3_handler)

for i in range(0, 100000): logger.info("test info message") logger.warning("test warning message") logger.error("test error message")

logging.shutdown()

image

dummybot88 commented 3 years ago

hello,

I'm also facing the same error. Could you please provide any inputs?

glepine-ivadolabs commented 3 years ago

I found a workaround, when creating the S3Handler pass an empty dict under encryption_options={} ie

S3Handler(file_name,bucket,other_arg,encryption_options={})

linlin994395 commented 3 years ago

I found a workaround, when creating the S3Handler pass an empty dict under encryption_options={} ie

S3Handler(file_name,bucket,other_arg,encryption_options={})

it works, thanks a lot

dummybot88 commented 3 years ago

I found a workaround, when creating the S3Handler pass an empty dict under encryption_options={} ie

S3Handler(file_name,bucket,other_arg,encryption_options={})

Thanks a ton, it worked