Skip to main content

py-fastapi-logging

ENV-переменные для управления логами

Уровень логов. debug - для площадок отладки, info - для PROM

LOG_LEVEL=info

Формат логов: SIMPLE (обычный) или JSON (JSON-STDOUT - лог в формате json в поток stdout)

LOG_FORMAT=SIMPLE

Папка, в которой будут лежать логи

LOG_DIR=/var/log/

Название файла лога

LOG_FILENAME=production.log

Добавление переменных в лог (JSON-формат) из переменных окружения

LOG_ENV_EXTRA="field1:ENV_VAR_NAME_1,field2:ENV_VAR_NAME_2"

Количество старых лог файлов, которые сохраняются при ротации логов

LOG_FILES_COUNT=5

Максимальный размер лог файла в мегабайтах для ротации логов

LOG_FILE_SIZE=10

Интеграция в FastAPI приложение

from fastapi import FastAPI
from py_fastapi_logging.middlewares.logging import LoggingMiddleware
app = FastAPI()
app.add_middleware(LoggingMiddleware, app_name='my_app_name')

Использование логгера в приложениях не на FastAPI

import logging
from py_fastapi_logging.config.config import init_logger
init_logger(app_name='my_app_name')
logger = logging.getLogger()

Metadata

Release files for py-fastapi-logging 0.7.3

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

Source distribution (sdist)

Source distribution for py-fastapi-logging 0.7.3
File Size Uploaded Provenance Actions
py_fastapi_logging-0.7.3.tar.gz 13.3 kB Without provenance Details for py_fastapi_logging-0.7.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-fastapi-logging 0.7.3
File Interpreter ABI Platform Actions
py_fastapi_logging-0.7.3-py3-none-any.whl Python 3 none any Details for py_fastapi_logging-0.7.3-py3-none-any.whl

Total release size: 31.3 kB

Release files / py_fastapi_logging-0.7.3.tar.gz

Download URL py_fastapi_logging-0.7.3.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
286c99c3c600473bc63e890f452da4b0dc9572319d60d89cbfcf8c31ba374dc3
BLAKE2b-256 checksum
How to use checksums
ce760b53b9bf80c7cc24a8ec826777843ad93de7161f18700ad00e5e095fdb4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.18.5-100.fc42.x86_64

Release files / py_fastapi_logging-0.7.3-py3-none-any.whl

Download URL py_fastapi_logging-0.7.3-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c8b57e7aec56eb89114759cd64b59b0afe663ae9f3b37c266ff5a50b992218a
BLAKE2b-256 checksum
How to use checksums
5ce5407bd960a92bfd80fae46445462e00fe7c8eb8190c7161bb6994dbd64af8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.7 Linux/6.18.5-100.fc42.x86_64

Security for py-fastapi-logging 0.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.3 This release

2 release files No provenance

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