We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python Lambda Logger is a little odd
logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) logger.info("Foo")
Won't print 'foo' to the cloudwatch logs,
This stack overflow answer explains it a little more
From this stack overflow answer on the same thread, we see the comment that since python 3.8 we can just use the force=True on basicConfig.
force=True
From https://docs.python.org/3/library/logging.html#logging.basicConfig:
This function does nothing if the root logger already has handlers configured, unless the keyword argument force is set to True.
So action is to set force as 'true' to logging.basicConfig.
We should probably also use format='%(asctime)s %(message)s' to provide timestamps in the cloudwatch logs of when logs were printed
format='%(asctime)s %(message)s'
The text was updated successfully, but these errors were encountered:
Standardise loggers in python lambda functions
ecd930d
Resolves #644
alexiswl
Successfully merging a pull request may close this issue.
Python Lambda Logger is a little odd
Won't print 'foo' to the cloudwatch logs,
This stack overflow answer explains it a little more
From this stack overflow answer on the same thread, we see the comment that since python 3.8 we can just use the
force=True
on basicConfig.From https://docs.python.org/3/library/logging.html#logging.basicConfig:
This function does nothing if the root logger already has handlers configured, unless the keyword argument force is set to True.
So action is to set force as 'true' to logging.basicConfig.
We should probably also use
format='%(asctime)s %(message)s'
to provide timestamps in the cloudwatch logs of when logs were printedThe text was updated successfully, but these errors were encountered: