Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the logging integration send Sentry logs #4150

Closed
antonpirker opened this issue Mar 18, 2025 · 1 comment
Closed

Make the logging integration send Sentry logs #4150

antonpirker opened this issue Mar 18, 2025 · 1 comment
Assignees

Comments

@antonpirker
Copy link
Member

antonpirker commented Mar 18, 2025

Make the logging integration create breadcrumbs and issues.

Something like this:

sentry_sdk.init(
    ...
    _experiments={
        "enable_sentry_logs": True
    }
)

logger = logging.Logger("some-logger")
logger.info('Finished sending answer! #chunks=%s', chunks).  # <-- will send sentry logs
antonpirker added a commit that referenced this issue Mar 27, 2025
We have integrations that make the python logger create breadcrumbs and
issues. This adds a third handler which creates Sentry logs on
`logger.log` statements.

Enable the logger with:
```python
sentry_sdk.init(
    ...
    _experiments={
        "enable_sentry_logs": True
    }
)

some_logger = logging.Logger("some-logger")
some_logger.info('Finished sending answer! #chunks=%s', chunks)
```

![Screenshot 2025-03-17 at 4 12
27 PM](https://github.com/user-attachments/assets/0e8dcd46-6361-47c0-8662-389fcb924969)

Refs #4150

---------

Co-authored-by: Anton Pirker <[email protected]>
@antonpirker
Copy link
Member Author

this is done and experimental version has been released as 2.25.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants