

Using python Logging with AWS Lambda
As the AWS documentation suggests:
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def my_logging_handler(event, context):
logger.info('got event{}'.format(event))
logger.error('something went wrong')
Now I made:
import logging
logging.basicConfig(level = logging.INFO)
logging.info("Hello World!")
The first snippet of code prints in the Cloud Watch
console, but the second one no.
I didn't see any difference as the two snippets are using the root logger.
Python


Your essay was really helpful to me, and I want to read more of your writings in the future. I also recently discovered a fairly nice game called smash karts , which you may join and play with me if you have spare time.


AWS Lambda automatically monitors Lambda functions on your behalf and sends function metrics to Amazon CloudWatch. Your Lambda function comes with a CloudWatch Logs log group and a log stream for each instance of your function. The Lambda runtime environment sends details about each invocation to the log stream, and relays logs and other output from your function's code.


This information is really helpful for us thanks for sharting this kind of post please keep suggesting such post. Myindigocard
Login to add comment