Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ You can inject your own custom proc to handle buffer overflow in the event of co
import msgpack
from io import BytesIO

def handler(pendings):
def overflow_handler(pendings):
unpacker = msgpack.Unpacker(BytesIO(pendings))
for unpacked in unpacker:
print(unpacked)

logger = sender.FluentSender('app', host='host', port=24224, buffer_overflow_handler=handler)
logger = sender.FluentSender('app', host='host', port=24224, buffer_overflow_handler=overflow_handler)

You should handle any exception in handler. fluent-logger ignores exceptions from ``buffer_overflow_handler``.

Expand All @@ -198,7 +198,7 @@ module.

logging.basicConfig(level=logging.INFO)
l = logging.getLogger('fluent.test')
h = handler.FluentHandler('app.follow', host='host', port=24224, buffer_overflow_handler=handler)
h = handler.FluentHandler('app.follow', host='host', port=24224, buffer_overflow_handler=overflow_handler)
formatter = handler.FluentRecordFormatter(custom_format)
h.setFormatter(formatter)
l.addHandler(h)
Expand Down Expand Up @@ -228,7 +228,7 @@ You can inject your own custom proc to handle buffer overflow in the event of co
import msgpack
from io import BytesIO

def handler(pendings):
def overflow_handler(pendings):
unpacker = msgpack.Unpacker(BytesIO(pendings))
for unpacked in unpacker:
print(unpacked)
Expand Down Expand Up @@ -264,7 +264,7 @@ A sample configuration ``logging.yaml`` would be:
host: localhost
port: 24224
tag: test.logging
buffer_overflow_handler: handler
buffer_overflow_handler: overflow_handler
formatter: fluent_fmt
level: DEBUG
none:
Expand Down