
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
This library provides the ability of converting django logs to JSON.
Using standard Json library:
pip install django-json-logger
To use Orjson:
pip install django-json-logger[orjson]
and add to Django settings LOGGING_SERIALIZER="orjson"
To use Ujson:
pip install django-json-logger[ujson]
and add to Django settings LOGGING_SERIALIZER="ujson"
Note: If you're using zsh you need to escape square brackets: pip install ... [ujson]
# setting.py
LOGGING_APP_NAME = 'your_app_name' # required
LOGGING_FIELDS = ('levelname', 'name', 'module', 'process', 'thread', 'pathname', 'asctime')
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'json': {
'()': 'django_json_logging.formatters.JSONFormatter',
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
'formatter': 'json',
},
},
'loggers': {
'': {
'handlers': ['console'],
'level': 'WARNING',
},
'django': {
'handlers': ['console'],
'level': 'WARNING',
'propagate': False,
},
},
}
Somewhere in the code
import logging
your_json_logger = logging.getLogger('json_logger')
your_json_logger.warning('Something happened here', extra={'event_code': 'xxx'})
FAQs
A Django app to logging in json format.
We found that django-json-logger 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
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.