8000 extra fields · Issue #47 · fluent/fluent-logger-python · GitHub
[go: up one dir, main page]

Skip to content
extra fields #47
Closed
Closed
@dkavraal

Description

@dkavraal

I wasn't able to pass extra fields. Have you tested such:

from fluent import handler
custom_format = {
  'host': '%(hostname)s',
  'where': '%(module)s.%(funcName)s',
  'type': '%(levelname)s',
  'stack_trace': '%(exc_text)s'
}
log = logging.getLogger('fluent.test')
log.setLevel(logging.DEBUG)
h = handler.FluentHandler('app.python', host='127.0.0.1', port=24224)
formatter = handler.FluentRecordFormatter(custom_format)
h.setFormatter(formatter)
log.addHandler(h)

log.debug('python fluent log test', extra={'extraField': 'test'} )

on the last line I am expecting fluentd(td-agent) to pass the extraField into the collector.

Is there sth I'm missing?

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

      0