Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add configuration of extra_fields #8

merged 1 commit into from

2 participants

Colin Howe Sever Băneșiu
Colin Howe

Fixes issue #7

Sever Băneșiu

Thanks for contributing this, can you please update the documentation to reflect this additional flag?
Please include specific references to logbook and how it breaks if the flag is set to True.

Sever Băneșiu severb merged commit 833b479 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2012
  1. Colin Howe
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 3 deletions.
  1. +6 −2 graypy/
  2. +1 −1 
8 graypy/
@@ -12,8 +12,10 @@
class GELFHandler(DatagramHandler):
- def __init__(self, host, port, chunk_size=WAN_CHUNK, debugging_fields=True):
+ def __init__(self, host, port, chunk_size=WAN_CHUNK, debugging_fields=True,
+ extra_fields=True):
self.debugging_fields = debugging_fields
+ self.extra_fields = extra_fields
self.chunk_size = chunk_size
DatagramHandler.__init__(self, host, port)
@@ -61,7 +63,9 @@ def make_message_dict(self, record):
pn = getattr(record, 'processName', None)
if pn is not None:
fields['_process_name'] = pn
- return self.add_extra_fields(fields, record)
+ if self.extra_fields:
+ fields = self.add_extra_fields(fields, record)
+ return fields
def add_extra_fields(self, message_dict, record):
# skip_list is used to filter additional fields in a log message.
2 
@@ -5,7 +5,7 @@
- version='0.2.3',
+ version='0.2.4',
description="Python logging handler that sends messages in GELF (Graylog Extended Log Format).",
keywords='logging gelf graylog2 graylog udp',
Something went wrong with that request. Please try again.