-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add ability to customize the default logger #9210
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
Comments
Hey, thanks for writing in. I think it may make sense to allow to configure this, however we'd need to build this in a way that does not rely on globals (e.g. the custom logger needs to be on the client, and the |
Previously, Sentry used
With the new release, this broke, because Sentry does not use the logger in |
@DCzajkowski yeah we do not recommend relying on this object. It is internal API and does not follow semver. |
+1 on this, would be useful for projects with a little more advanced logging mechanics than console. |
This is on our backlog but still not on our immediate roadmap. Now would be the perfect time to contribute as we are preparing a new major release, meaning you could even break some APIs and get away with it! |
interested in this feature |
Problem Statement
Currently, the default logger used by Sentry is
globalThis.console
. However, our app has multiple transports for logging (remote, file, console etc.)With current Sentry implementation, we cannot redirect default Sentry logs to any of our transports without modifying the global console object.
Solution Brainstorm
We suggest adding a new configuration option that allows to specify the logging module, the same way you can specify a
transport
.I would expect
LoggerConsoleMethods
to be exported as a common interface to adhere to. Thelogger
configuration option would be:The text was updated successfully, but these errors were encountered: