Skip to content

AccelByte/justice-python-common-log

Repository files navigation

justice-python-common-log

Python Version License

Justice common log format for python

  • Free software: Apache Software License 2.0

Usage in flask

Basic

import flask
from justice_python_common_log.flask import Log

app = flask.Flask(__name__)
Log(app)

Exclude specific endpoint

Log(app, excluded_paths=['/swaggerui.*', '/analytics/apidocs'])

Exclude specific agent

Log(app, excluded_agents=['ELB'])

Usage in FastAPI

Basic

from fastapi import FastAPI
from justice_python_common_log.fastapi import Log

app = FastAPI()
Log(app)

Exclude specific endpoint

Log(app, excluded_paths=['/swaggerui.*', '/game-telemetry/apidocs'])

Exclude specific agent

Log(app, excluded_agents=['ELB'])

Environment variables

FULL_ACCESS_LOG_ENABLED : Enable full access log mode. Default: false.

FULL_ACCESS_LOG_SUPPORTED_CONTENT_TYPES : Supported content types to shown in request_body and response_body log. Default: application/json,application/xml,application/x-www-form-urlencoded,text/plain,text/html.

FULL_ACCESS_LOG_MAX_BODY_SIZE : Maximum size of request body or response body that will be processed, will be ignored if exceed more than it. Default: 10240 bytes

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

0 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors