Output syslog of the json format.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for Flask_Json_Syslog-0.1.28-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f31a23e77317ba639f0722d57ba350ce3077cbbeefb7abadad7c0f41d4574285 |
|
MD5 | a752640ec255966621ac4e3c37dc1e07 |
|
BLAKE2b-256 | ec6d62cb5443448a5001ec0f67f4ed286bf1897045185b7f945c58ccd8e3e52d |
Close
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 |