Skip to content

Issues with the logging.Handler interface #7

Closed
@aknapp

Description

@aknapp

So, I'm trying to integrate fluent into one of our apps, and I'm running into some issues using the logging.Handler interface.

First off, when I use the event interface, everything looks like I expect it to:

fluent_sender.setup('app', host='localhost', port=24224)
fluent_event.Event('info', {'connect': ''})

This gives me this output, which is exactly what I want:
2012-12-02T14:00:09-08:00 app.info {"connect":""}

When I try to use the logging.Handler interface, I get something different:

self.logger = logging.getLogger(self.__class__.__name__)
self.logger.addHandler(handler.FluentHandler('app', host='localhost', port=24224))
self.logger.info({'connect': ''})

This gives me this:
2012-12-02T13:08:05-08:00 app {"sys_module":"app","sys_name":"fluent","sys_host":"hostname","connect":""}
(that is all on one line)

Ideally, I would like the output to be the same as when I use the event interface. Also, when I specify multiple items in the log, like so:

self.logger.info({'level': 'info', 'connect': ''})

The fields in the log are not ordered, and show up in different order all the time.

Am I doing something wrong here? Can you point me in the right direction if so?

Thanks,
Andy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions