-
-
Notifications
You must be signed in to change notification settings - Fork 451
Add Sentry Log feature to Java SDK #4372
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
base: main
Are you sure you want to change the base?
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Add Sentry Log feature to Java SDK ([#4372](https://github.com/getsentry/sentry-java/pull/4372)) If none of the above apply, you can opt out of this check by adding |
// TODO SentryLevel.TRACE does not exists yet | ||
// log(SentryLevel.TRACE, message, args); |
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.
We should add this
throws IOException { | ||
writer.beginObject(); | ||
writer.name("items").value(logger, items); | ||
writer.endObject(); |
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.
I think we are missing the serialization of unknown
here
for (Object arg : args) { | ||
final @NotNull String type = getType(arg); | ||
attributes.put( | ||
"sentry.message.parameters." + i, new SentryLogEventAttributeValue(type, arg)); |
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.
"sentry.message.parameters." + i, new SentryLogEventAttributeValue(type, arg)); | |
"sentry.message.parameter." + i, new SentryLogEventAttributeValue(type, arg)); |
logger.log(SentryLevel.ERROR, message, exception); | ||
throw exception; | ||
} | ||
|
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.
Level is also required
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.
In that case it can probably become @NotNull
on SentryLogEvent
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.
Left some comments, otherwise LGTM as a first implementation
📜 Description
Add API for capturing logs.
💡 Motivation and Context
Partial implementation for #4350
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps