Skip to main content

Output syslog of the json format.

Project description

Downloads Supported Python versions Latest Version License

This is the Flask extension facility to output syslog of the Json form.

Installation

pip install flask-json-syslog

Example

config.py

JSON_SYSLOG_LEVEL = 'info'# Log level
JSON_SYSLOG_NUMBER = 168  # syslog.LOG_LOCAL5
JSON_SYSLOG_FACILITY = 6  # syslog.LOG_INFO

app.py

from flask import g
from flask_json_syslog import FlaskJsonSyslog

app = Flask(__name__)
flask_json_syslog = FlaskJsonSyslog(app)

...

@app.before_request
def before_request():
    g.json_log = flask_json_syslog.put

In your application

g.json_log({'foo': 'bar'}, ...)

(r)syslog.conf

...

$template json,"%msg%\n"
local5.* /var/log/local5.log;json

...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Flask-Json-Syslog-0.1.28.tar.gz (2.5 kB view details)

Uploaded Source

Built Distributions

Flask_Json_Syslog-0.1.28-py2.7.egg (4.2 kB view details)

Uploaded Source

File details

Details for the file Flask-Json-Syslog-0.1.28.tar.gz.

File metadata

File hashes

Hashes for Flask-Json-Syslog-0.1.28.tar.gz
Algorithm Hash digest
SHA256 4923c8037e50d45cde66b2319ab5de28939f99bade3912045f100609dd9cf47a
MD5 b32b26b46acd7aa3996d0b0678aea10b
BLAKE2b-256 2729cdf453e01ad095b27034275f9afc789434d47eeef44c871619f0f507dcd4

See more details on using hashes here.

File details

Details for the file Flask_Json_Syslog-0.1.28-py2.7.egg.

File metadata

File hashes

Hashes for Flask_Json_Syslog-0.1.28-py2.7.egg
Algorithm Hash digest
SHA256 f31a23e77317ba639f0722d57ba350ce3077cbbeefb7abadad7c0f41d4574285
MD5 a752640ec255966621ac4e3c37dc1e07
BLAKE2b-256 ec6d62cb5443448a5001ec0f67f4ed286bf1897045185b7f945c58ccd8e3e52d

See more details on using hashes here.

File details

Details for the file Flask-Json-Syslog-0.1.28.macosx-10.10-x86_64.tar.gz.

File metadata

File hashes

Hashes for Flask-Json-Syslog-0.1.28.macosx-10.10-x86_64.tar.gz
Algorithm Hash digest
SHA256 63cdea56e0ea92aaa144eaba54cfeab455b630ed6312939d04fe043533bcddde
MD5 97d2f7e4dd92f7e15d689a9c5bbb00b9
BLAKE2b-256 33f06da158050bfb798007c9fecd763bfe508a2bcb39a7e29f4a6ae953c1414f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page