
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
This library provides Python logging formatters to output JSON, 2 formatters are specific for Logstash message format version 0 or 1.
Using pip:
::
pip install json-logging-py
From source:
::
python setup.py install
The name of the library is jsonlogging
, it provides 3 formatters:
::
{
"tags": [
"env=prod",
"role=www"
],
"timestamp": "2015-09-22T22:40:56.178715Z",
"level": "ERROR",
"host": "server-01.example.com",
"path": "example.py",
"message": "hello world!",
"logger": "root"
}
::
{
"@source": "JSON://server-01.example.com/example.py",
"@source_host": "server-01.example.com",
"@message": "hello world!",
"@tags": [
"env=prod",
"role=www"
],
"@fields": {
"logger": "root",
"levelname": "ERROR"
},
"@timestamp": "2015-09-22T22:42:02.094525Z",
"@source_path": "example.py",
"@type": "JSON"
}
::
{
"host": "server-01.example.com",
"logger": "root",
"type": "JSON",
"tags": [
"env=prod",
"role=www"
],
"path": "example.py",
"@timestamp": "2015-09-22T22:43:11.966558Z",
"@version": 1,
"message": "hello world!",
"levelname": "ERROR"
}
::
import logging
import jsonlogging
logger = logging.getLogger()
logHandler = logging.StreamHandler()
# You can also use LogstashFormatterV0 or LogstashFormatterV1
formatter = jsonlogging.JSONFormatter(
hostname="server-01.example.com"
tags=["env=prod", "role=www"],
indent=4)
logHandler.setFormatter(formatter)
logger.addHandler(logHandler)
# You can pass additional tags
logger.error('hello world!', extra={"tags": ["hello=world"]})
.. |PyPi version| image:: https://img.shields.io/pypi/v/json-logging-py.svg :target: https://pypi.python.org/pypi/json-logging-py/
FAQs
JSON / Logstash formatters for Python logging
We found that json-logging-py 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
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.