module to log requests and response
Project description
to install logover use pip install logover once you install the package goto logover package and cut config.json file and put it into your folders main directory and change the "END_POINT" to wherever you want to dump your data and change "END_POINT_TO_SIMULATE_DB" to endpoint from where you will fetch includes and levels. config.json { "buffer_size":"5", "timer":"10", "END_POINT":"https://httpdump.io/bpmpg", "END_POINT_TO_SIMULATE_DB":"http://127.0.0.1:9000/", "time_to_refresh_cofg_file" : "30" }
in place of "END_POINT" put your own end point where you want to dumb the data. in include array you need to pass the route which you allow to log. If you put "*" it means you want to allow all the route. Do same configuration for levels. once you done with config file just put the code below to the end of all your route so that it will process all your route. (REMEMBER:- put this at the end of all your route. ) @app.before_request def start_timer(): print('before every request') g.start = time.time()
@app.after_request def fun(response): myRouteLog.log_request(response) return response
now in the last step :- if you want to use logger for specific task like INFO,ERROR,WARNING use like :- logover.info('your message') logover.error('your message') logover.warn('your message')
by default buffersize is 5 and time out is 30sec, if you want to change it just change in config.json file and restart the server.
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 Distributions
Built Distribution
Hashes for pythonlogger-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94cc59f94d2dc87c0288e547c3d8b9e2be4e02aaf1fc126dcaa5514e1854e7c3 |
|
MD5 | 2f86c816fa9db1130742d3edacb17bab |
|
BLAKE2b-256 | 761a7d91ca6a3ea6b2eab2313377416bfc64f3831446d926196fa1b402e392b4 |