百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

django-logtailer

> 编程语言
开源

允许从 Django 管理界面直接实时查看任何日志文件条目。它允许您使用正则表达式过滤日志,并提供了一个可视化的日志查看器。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

允许从 Django 管理界面直接实时查看任何日志文件条目。它允许您使用正则表达式过滤日志,并提供了一个可视化的日志查看器。

================================= Django LogTailer

:Version: 2.0 :Source: http://github.com/fireantology/django-logtailer/

Allows the viewing of any log file entries in real time directly from the Django admin interface. It allows you to filter on logs with regex and offer also a log clipboard for save desired log lines to the django db.

Demos

.. image:: docs/log-reader.png :alt: LogTailer log reader in the Django admin :width: 800

  • Demo Video_

.. _Video: http://www.vimeo.com/28891014

Requirements

  • Django >= 6.1.1
  • Python >= 3.12
  • Sessions enabled

Installation

  • Install the package with pip install django-logtailer
  • Add it to the INSTALLED_APPS in your SETTINGS
  • Set LOGTAILER_ALLOWED_ROOTS in your SETTINGS (see Settings below)
  • add to urls.py: url(r'^logs/', include('logtailer.urls')),
  • Run manage.py migrate for create the required tables
  • Run manage.py collectstatic

Settings

LOGTAILER_ALLOWED_ROOTS (mandatory): list of directories log files are allowed to live in. Paths are fully resolved (symlinks and .. included) before checking, preventing path traversal (CWE-22). If the setting is missing or empty, access to every log file is denied::

LOGTAILER_ALLOWED_ROOTS = ['/var/log/myapp']

Filters

Filters (saved in the admin or typed in the custom filter field) are Python regular expressions_ evaluated server-side with re.search() against each raw log line. Only matching lines are returned to the browser.

  • Write plain patterns, not JavaScript literals: use networkmanager, not /networkmanager/.
  • Flags are inline groups: case-insensitive matching is (?i)networkmanager, not /networkmanager/i.
  • An invalid regex falls back to a literal substring match.

.. warning:: Filters saved with versions before 2.0 were evaluated as JavaScript regex literals and may no longer match. Rewrite them in Python syntax, e.g. /networkmanager/i becomes (?i)networkmanager.

.. _Python regular expressions: https://docs.python.org/3/library/re.html

Running tests

From the repository root::

bash
python runtests.py

The suite uses a minimal standalone settings module (tests/settings.py) with an in-memory SQLite database, so no extra setup is needed.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言