Skip to main content

scrapy-lokilog

Scrapy extension for non-blocking logging to Grafana Loki via lokilog.

Installation

pip install scrapy-lokilog

Quick Start

Add the extension and Loki URL to your Scrapy settings.py:

EXTENSIONS = {
    'scrapy_lokilog.LokiLogExtension': 500,
}

LOKILOG_URL = "http://localhost:3100"

# Optional: Add static labels
LOKILOG_LABELS = {"env": "prod", "service": "scraper"}

# Optional: Fields from `extra={}` to promote to Loki labels
LOKILOG_EXTRACTED_LABELS = ["user_id", "spider_name"]

# Optional: List of loggers to ignore (e.g. noisy libraries)
LOKILOG_EXCLUDE_LOGGERS = ["botocore", "urllib3"]

scrapy-lokilog (RU)

Расширение Scrapy для неблокирующей отправки логов в Grafana Loki через lokilog.

Установка

pip install scrapy-lokilog

Быстрый старт

Добавьте расширение и URL вашего Loki в settings.py проекта Scrapy:

EXTENSIONS = {
    'scrapy_lokilog.LokiLogExtension': 500,
}

LOKILOG_URL = "http://localhost:3100"

# Опционально: Добавить статические лейблы
LOKILOG_LABELS = {"env": "prod", "service": "scraper"}

# Опционально: Поля из `extra={}`, которые станут лейблами в Loki
LOKILOG_EXTRACTED_LABELS = ["user_id", "spider_name"]

# Опционально: Список логгеров для исключения (например шумные библиотеки)
LOKILOG_EXCLUDE_LOGGERS = ["botocore", "urllib3"]

Metadata

Release files for scrapy-lokilog 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapy-lokilog 1.0.1
File Size Uploaded
scrapy_lokilog-1.0.1.tar.gz 2.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-lokilog 1.0.1
File Interpreter ABI Platform
scrapy_lokilog-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.1 kB

Release files / scrapy_lokilog-1.0.1.tar.gz

Download URL scrapy_lokilog-1.0.1.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d284a1e230334a68679ee8006e2cb49961e944dc268d989b83d22e5a4f218f4e
BLAKE2b-256 checksum
How to use checksums
737d95e13dae6ee501cd4452e4b65ad279f877aac2149754ed03438f22003329
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.4 Windows/11

Release files / scrapy_lokilog-1.0.1-py3-none-any.whl

Download URL scrapy_lokilog-1.0.1-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6f51075f2f875d367036d45ab34751624aed0993a29244ff1dc8b75f835c654
BLAKE2b-256 checksum
How to use checksums
1f73808910f8328dfee0165886e4cb4f6e8f691109c9baee65185b200d1c6e15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.4 Windows/11

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page