underdogio / flask-graylog Goto Github PK
View Code? Open in Web Editor NEWFlask extension to configure a Graylog logger from your Flask app
Flask extension to configure a Graylog logger from your Flask app
Hi,
I'm having a difficult time to configure the extension to log only certain errors that occur. How would one do that?
Best wishes
Hi,
There have been changes in graypy package. This is breaking flask-graylog throwing AttributeError: module 'graypy' has no attribute 'GELFHandler'
GELFHandler has been replaced with GELFUDPHandler
& GELFTcpHandler being restructured into GELFTCPHandler
I guess you are already aware, but it is not python3 compatible
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/local/lib/python3.4/dist-packages/flask_restful/__init__.py", line 271, in error_router
return original_handler(e)
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.4/dist-packages/flask/_compat.py", line 32, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1479, in full_dispatch_request
response = self.process_response(response)
File "/usr/local/lib/python3.4/dist-packages/flask/app.py", line 1691, in process_response
response = handler(response)
File "/usr/local/lib/python3.4/dist-packages/flask_graylog.py", line 121, in after_request
for key, value in request.environ.iteritems()
AttributeError: 'dict' object has no attribute 'iteritems'
Hello there!
Thanks for this Flask extension. I experience problems with my logs which I send to my Graylog Server, because when I restart my project (it's in Docker), a random source
field is assigned every time.
I would want to have an ability to set localname=
param in graypy.GELFHandler
, but, unfortunately, the extension does not support the setting of that field.
It'd be great if you added the GRAYLOG_LOCALNAME
as a configuration option (along with GRAYLOG_HOST
, GRAYLOG_PORT
and others) in flask_graylog.py
, function def init_app()
.
Probably, to exclude the possibility of such difficulties in the future, you'd want to create a generic function, which will cover every possible param that can be passed to graypy.GELFHandler
(e.g. all the related options in passed config should start with GRAYLOG_
and then have an exact name as params in graypy.GELFHandler
in uppercase, like you did before with several options)
Thanks in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.