You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Library is swallowing log messages from function code #38
For whatever reason the lambda runtime interface client doesn't follow standard python logging. It definitely needs top e fixed. There is a logger in aws_lambda_powertools for bootstrapping the loggers and emits json logs as aws CloudWatch logs use structured logging. I assume this should work in cases where you are not using a lambda.
I ended having to do this to get logging to work for imported modules:
module being imported
# mymodule.pyimportinspectimportloggingfromaws_lambda_powertoolsimportLoggerifos.path.basename(sys.modules["__main__"].__file__) =="app.py":
# use aws lambda logger, formatterlogger=Logger(child=True)
else:
# use default loggerlogger=logging.getLogger(__name__)
logger.addHandler(NullHandler())
Foo:
...
Activity
Triangulum9r commentedon Jul 21, 2021
For whatever reason the lambda runtime interface client doesn't follow standard python logging. It definitely needs top e fixed. There is a logger in aws_lambda_powertools for bootstrapping the loggers and emits json logs as aws CloudWatch logs use structured logging. I assume this should work in cases where you are not using a lambda.
I ended having to do this to get logging to work for imported modules:
module being imported
importing module