Skip to content

Unable to use a custom log formatter #381

Open
@jackton1

Description

@jackton1

Formatter

...
	'formatters': {
        'custom': {
            'format': '%(message)s %(my_object)r',
        },
    },

Handler

	'handlers': {
        'custom': {
            'level': 'WARNING',
            'class': 'rollbar.logger.RollbarHandler',
            'formatter': 'custom',
        },
    },

Using:

log.warning('This is a test', extra={'my_object': my_object})

Expectation:

The correct formatted message shows up in rollbar.

currently shows

"This is a test"

Instead of

"This is a test <MyObject.__repr__(...)>"

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