
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
aws-lambda-logging
Advanced tools
.. image:: https://gitlab.com/hadrien/aws_lambda_logging/badges/master/build.svg
.. image:: https://gitlab.com/hadrien/aws_lambda_logging/badges/master/coverage.svg?job=Run%20py.test
Better logging for aws lambda running on python runtime environment with a highly opinionated JSON formatting to ease parsing on any logging system.
.. code::
import aws_lambda_logging
def handler(event, context):
aws_lambda_logging.setup(level='DEBUG')
...
You can separately set the logging level for Boto (defaults to the same level):
.. code::
import aws_lambda_logging
def handler(event, context):
aws_lambda_logging.setup(level='DEBUG', boto_level='CRITICAL')
...
You can add keyword arguments to be logged each time, such as lambda request id.
.. code::
import aws_lambda_logging
def handler(event, context):
aws_lambda_logging.setup(level='DEBUG',
aws_request_id=context.get('aws_request_id'))
log.debug('Just a try!')
...
It will output JSON formatted message:
.. code::
{
"level": "DEBUG",
"timestamp": "2016-10-03 13:27:57,438",
"apigw_request_id": "323fee86-896d-11e6-b7fd-2d914ea80962",
"location": "root.handler:6",
"message": "Just a try!"
}
You can input a JSON string:
.. code::
log.debug('{"Details": [1,2,3]}')
It will output JSON formatted message with the JSON string embedded properly:
.. code::
{
"level": "DEBUG",
"timestamp": "2016-10-03 13:27:57,438",
"apigw_request_id": "323fee86-896d-11e6-b7fd-2d914ea80962",
"location": "root.handler:6",
"message": {
"Details": [
1,
2,
3
]
}
}
You can input a dict:
.. code::
log.debug({"Details": [1,2,3]})
It will output JSON formatted message with the dict values:
.. code::
{
"level": "DEBUG",
"timestamp": "2016-10-03 13:27:57,438",
"apigw_request_id": "323fee86-896d-11e6-b7fd-2d914ea80962",
"location": "root.handler:6",
"message": {
"Details": [
1,
2,
3
]
}
}
Any values that can otherwise be serialisabled to JSON are coerced to
strings. This behaviour can be changed by parsing a formatter
function to the json_default keyword argument.
FAQs
Nanolib to enhance logging in aws lambda
We found that aws-lambda-logging demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.