All Projects → resurfaceio → logger-python

resurfaceio / logger-python

Licence: Apache-2.0 license
Log API requests and responses with Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to logger-python

TikTokDownloader PyWebIO
🚀「Douyin_TikTok_Download_API」是一个开箱即用的高性能异步抖音|TikTok数据爬取工具,支持API调用,在线批量解析及下载。
Stars: ✭ 919 (+4077.27%)
Mutual labels:  aiohttp
Pyro-FileStreamBot
Stream Telegram files to web
Stars: ✭ 38 (+72.73%)
Mutual labels:  aiohttp
DEEPaaS
A REST API to serve machine learning and deep learning models
Stars: ✭ 26 (+18.18%)
Mutual labels:  aiohttp
aiohttp-three-template
Project template for Python aiohttp three-tier web applications
Stars: ✭ 20 (-9.09%)
Mutual labels:  aiohttp
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+1640.91%)
Mutual labels:  aiohttp
python-logi-circle
Python 3.6+ API for Logi Circle cameras
Stars: ✭ 23 (+4.55%)
Mutual labels:  aiohttp
cirrina
cirrina is an opinionated asynchronous web framework based on aiohttp
Stars: ✭ 32 (+45.45%)
Mutual labels:  aiohttp
aiohttp-json-rpc
Implements JSON-RPC 2.0 using aiohttp
Stars: ✭ 54 (+145.45%)
Mutual labels:  aiohttp
megadlbot oss
Megatron was a telegram file management bot that helped a lot of users, specially movie channel managers to upload their files to telegram by just providing a link to it. The project initially started as roanuedhuru_bot which lately retired and came back as Megatron which was a side project of the famous Maldivian Telegram community - @baivaru u…
Stars: ✭ 151 (+586.36%)
Mutual labels:  aiohttp
aiohttp-swagger3
Library for swagger documentation browsing and validating aiohttp requests using swagger specification 3.0
Stars: ✭ 54 (+145.45%)
Mutual labels:  aiohttp
aioneo4j
asyncio client for neo4j
Stars: ✭ 29 (+31.82%)
Mutual labels:  aiohttp
Pyaiodl
A python Asynchronous Downloader - Pyaiodl
Stars: ✭ 40 (+81.82%)
Mutual labels:  aiohttp
python3-concurrency
Python3爬虫系列的理论验证,首先研究I/O模型,分别用Python实现了blocking I/O、nonblocking I/O、I/O multiplexing各模型下的TCP服务端和客户端。然后,研究同步I/O操作(依序下载、多进程并发、多线程并发)和异步I/O(asyncio)之间的效率差别
Stars: ✭ 49 (+122.73%)
Mutual labels:  aiohttp
aioScrapy
基于asyncio与aiohttp的异步协程爬虫框架 欢迎Star
Stars: ✭ 34 (+54.55%)
Mutual labels:  aiohttp
netunnel
A tool to create network tunnels over HTTP/S written in Python 3
Stars: ✭ 19 (-13.64%)
Mutual labels:  aiohttp
aiosfstream
Salesforce Streaming API client for asyncio
Stars: ✭ 46 (+109.09%)
Mutual labels:  aiohttp
pytest-aiohttp
pytest plugin for aiohttp support
Stars: ✭ 110 (+400%)
Mutual labels:  aiohttp
stream video server
demonstrates how to create video streaming server with the help of aiohttp and opencv
Stars: ✭ 15 (-31.82%)
Mutual labels:  aiohttp
aiohttp-cache
A cache system for aiohttp server
Stars: ✭ 39 (+77.27%)
Mutual labels:  aiohttp
tomodachi
💻 Microservice library / framework using Python's asyncio event loop with full support for HTTP + WebSockets, AWS SNS+SQS, RabbitMQ / AMQP, middleware, etc. Extendable for GraphQL, protobuf, gRPC, among other technologies.
Stars: ✭ 170 (+672.73%)
Mutual labels:  aiohttp

resurfaceio-logger-python

Easily log API requests and responses to your own system of record.

PyPI CodeFactor License Contributing

Contents

Dependencies

Requires Python 3.7 or higher and a requests HTTP library. No other dependencies to conflict with your app.

Installing With pip

pip3 install --upgrade usagelogger

Logging From AIOHTTP

from aiohttp import web
from usagelogger.middleware.aiohttp import HttpLoggerForAIOHTTP

async def test(request):
    return web.Response(text="Hello")

app = web.Application(
    middlewares=[
        HttpLoggerForAIOHTTP(
            url="http://localhost:7701/message", rules="include debug"
        )
    ]
)
app.router.add_get("/", test)
web.run_app(app)

Logging From Django

First edit settings.py to register middleware, like this:

Note: We recommend placing Resurface middleware at the top in the middleware stack.

MIDDLEWARE = [
    "usagelogger.middleware.django.HttpLoggerForDjango",  # Always on the top
    "django.middleware...",
]

Then add a new section to settings.py for logging configuration, like this:

USAGELOGGER = {
    'url': 'http://localhost:7701/message', 
    'rules': 'include debug' 
}

Logging From Flask

from flask import Flask
from usagelogger.middleware.flask import HttpLoggerForFlask

app = Flask(__name__)

app.wsgi_app = HttpLoggerForFlask(  # type: ignore
    app=app.wsgi_app, url="http://localhost:7701/message", rules="include debug"
)

@app.route("/")
def home():
    return "This route works!"

app.run(debug=True)

Logging From Requests

from usagelogger import resurface

s = resurface.Session(url="http://localhost:7701/message", rules="include debug")
s.get(...)

Logging With API

Loggers can be directly integrated into your application using our API. This requires the most effort compared with the options described above, but also offers the greatest flexibility and control.

API documentation

Protecting User Privacy

Loggers always have an active set of rules that control what data is logged and how sensitive data is masked. All of the examples above apply a predefined set of rules (include debug), but logging rules are easily customized to meet the needs of any application.

Logging rules documentation


© 2016-2022 Resurface Labs Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].