-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(node): Add logging public APIs to Node SDKs #15764
Conversation
Okay Q for the group. We export a logger namespace in both Node and Browser, but they contain two different sets of methods. How do we make the Does |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I think the naming of ...Fmt
is fitting as well 👍
Just so everyone on the team is comfortable with the additional API, I'm going to walk through this PR on monday at planning. |
After meeting with the team, we decided to unify the API. You can either pass a message and attributes or a message template, params and attributes. Sentry.logger.trace('Starting database connection', {
database: 'users',
connectionId: 'conn_123'
}); Sentry.logger.trace('Database connection %s established for %s',
['successful', 'users'],
{ connectionId: 'conn_123' }
); |
d8fefc1
to
3447bb6
Compare
size-limit report 📦
|
Heya @AbhiPrasad, wondering when's the next release schedule that would bring this change? |
@aldy505 My plan is that our experimental logs support for JavaScript goes out with the next release, We won't mark it ready for self hosted until we have all the feature flags + infra stable. Currently there's still some more relay and snuba changes left before we're ready for that. |
I already have it running on self hosted :) Some folks that are using SH already uses Ourlogs. |
oh awesome! We'll start posting GH discussions for SDK setups + minimum required versions soon then, python and javascript first, but everything else will follow. If you want a specific SDK to be added sooner, please leave a comment in the GH discussion. |
Yes, thank you! I have my own custom Go SDK, so I'll use that. You can refer here if you have any users that want to enable it on SH: getsentry/self-hosted#3560 |
ref #15526
Continuing off the work from #15763, this PR adds the logging public API to the Node SDK. It also adds a basic weight-based flushing strategy to the SDK that is in the server-runtime client.
The main file added was
log.ts
. In that file I've added logger methods fortrace
,debug
,info
,warn
,error
,fatal
(the log severity levels) as well as an internal capture log helper all these methods call.Usage: