Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
django-log-inspector
Advanced tools
Django Log Inspector offers real-time monitoring and analysis of log files in Django projects. It delivers a fast and live-view of log data, eliminating manual page refreshing. With an intuitive interface and live update functionality, it streamlines log file management for easier issue tracking and troubleshooting in Django applications.
Django Log Inspector is available directly from PyPI:
pip install django-log-inspector
Add in INSTALLED_APPS
installed_apps = [
...
'log_inspector',
]
Include in the URLconf
path('logs/', include('log_inspector.urls'))
The directory of log files in your project
LOG_INSPECTOR_FILES_DIR = 'logs/'
A file is included if the pattern is matched, or it is specified
LOG_INSPECTOR_FILES = ['logfile1', 'logfile2', ...] # default: []
LOG_INSPECTOR_FILES_PATTERN = '*.log*'
You must specify the patterns in which your log files start with
LOG_INSPECTOR_PATTERNS = ['[INFO]', '[DEBUG]', '[WARNING]', '[ERROR]', '[CRITICAL]']
How logs are displayed
LOG_INSPECTOR_PAGE_LENGTH = 25 # total logs per-page
LOG_INSPECTOR_MAX_READ_LINES = 1000 # total logs that are read
LOG_INSPECTOR_EXCLUDE_TEXT_PATTERN = None # String regex expression to exclude the log
Optionally you can set the next variables in order to customize
LOG_INSPECTOR_FILE_LIST_TITLE = "Custom title" # default: None
LOG_INSPECTOR_FILE_LIST_STYLES = "/static/css/my-custom.css" # default: None
Logs are only accessible to logged-in superusers. If your login URL is different from Django's default, specify it in your settings.
LOGIN_URL = '/my-custom-admin/login/'
Deploy static files by running the command
python manage.py collectstatic
Start the development server and visit
http://127.0.0.1:8000/logs/
FAQs
Real-Time monitoring and analysis of logs
We found that django-log-inspector 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.