Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Setting transport class in logging dict config #1199

Open
@aspyatkin

Description

@aspyatkin

Hello, I have encountered a problem after upgrading from raven 5.x and not sure how to deal with it better.

In older raven versions it was allowed to set Transport in DSN parameter. Since my applications make use of logging dict config, I used to set Transport there. From now on it produces a warning Transport selection via DSN is deprecated. I was not able to set Transport class explicitly in logging dict config:

handlers:
  default:
    level: DEBUG
    class: logging.StreamHandler
    formatter: default
    stream: ext://sys.stdout
  sentry:
    level: INFO
    class: raven.handlers.logging.SentryHandler
    dsn: http://*****:*****@sentry.*****.local/11
    transport: raven.transport.threaded_requests.ThreadedRequestsHTTPTransport
    environment: development

Judging by the code, SentryHandler won't be instantiated if transport is of type str and not callable.
I wonder if there is an other way to set Transport class in logging dict config? Might an extra parameter transport_class be implemented in next versions so as to instruct SentryHandler to load the desired type of Transport by its string identifier?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions