0002-add-a-graypy-handler-if-GRAYLOG_URL-exists-10411.patch
debian/control | ||
---|---|---|
9 | 9 | |
10 | 10 |
Package: wcs |
11 | 11 |
Architecture: all |
12 |
Depends: ${python:Depends}, python-quixote, python-scgi, graphviz, python-feedparser, python-imaging |
|
12 |
Depends: ${python:Depends}, python-quixote, python-scgi, graphviz, python-feedparser, python-imaging, python-graypy
|
|
13 | 13 |
Recommends: python-dns, python-xlwt, python-qrcode, libjs-leaflet, python-magic |
14 | 14 |
Suggests: libapache2-mod-scgi | libapache-mod-scgi, python-libxml2, python-lasso, python-psycopg2 |
15 | 15 |
Description: web application to design and set up online forms |
wcs/qommon/publisher.py | ||
---|---|---|
58 | 58 |
import urllib |
59 | 59 | |
60 | 60 |
from qommon import _ |
61 |
try: |
|
62 |
import graypy |
|
63 |
except ImportError: |
|
64 |
graypy = None |
|
65 | ||
61 | 66 | |
62 | 67 |
class ImmediateRedirectException(Exception): |
63 | 68 |
def __init__(self, location): |
... | ... | |
960 | 965 |
'%(session_id)s %(path)s %(user_id)s - %(message)s') |
961 | 966 |
hdlr.setFormatter(formatter) |
962 | 967 |
self._app_logger.addHandler(hdlr) |
968 |
if os.environ.get('GRAYLOG_URL') and graypy: |
|
969 |
host = os.environ['GRAYLOG_URL'].split(':', 1)[0] |
|
970 |
port = int(os.environ['GRAYLOG_URL'].split(':', 1)[0]) |
|
971 |
hdlr = graypy.GELFHandler(fqdn=True, host=host, port=port) |
|
963 | 972 |
if debug: |
964 | 973 |
self._app_logger.setLevel(logging.DEBUG) |
965 | 974 |
else: |
966 |
- |