DEV Community

Discussion on: Django and Cloudwatch: Logging in a place you can see

Collapse
 
ashman profile image
Ashman • Edited

the boto3 session doesn't work for me. It shows an error:

session object has no attribute get_paginator()

I used boto3 client instead.

Collapse
 
ashman profile image
Ashman

But using boto3.client() there is a delay in logs. It takes upto a minute to get the logs visible in aws cloudwatch. Any fix to that?

Collapse
 
ashman profile image
Ashman • Edited

I did something like this:

logger_boto3_session = boto3.client(
"logs",
aws_access_key_id=CLOUDWATCH_AWS_ID,
aws_secret_access_key=CLOUDWATCH_AWS_KEY,
region_name=AWS_DEFAULT_REGION,
)

and changing boto3_session to boto3_client in handlers