-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(go): Modify docs to follow logger API changes #14260
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: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 9.27kB (0.04%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
view changes for bundle: sentry-docs-server-cjsAssets Changed:
|
@@ -11,149 +11,128 @@ With Sentry Structured Logs, you can send text based log information from your a | |||
|
|||
## Requirements | |||
|
|||
Logs in Go are supported in Sentry Go SDK version `0.33.0` and above. | |||
Logs in Go are supported in Sentry Go SDK version `0.33.0` and above. For using integrations of other log libraries, have a look at each specific page for more details on requirements. |
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.
Logs in Go are supported in Sentry Go SDK version `0.33.0` and above. For using integrations of other log libraries, have a look at each specific page for more details on requirements. | |
Logs in Go are supported in Sentry Go SDK version `0.33.0` and above. To use integrations with other logging libraries, check their specific documentation pages for detailed requirements. |
includes/logs/go-ctx-usage-alert.mdx
Outdated
@@ -0,0 +1,4 @@ | |||
## Correlating Logs with Traces |
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.
## Correlating Logs with Traces | |
## Correlating Logs With Traces |
## Correlating Logs with Traces | ||
|
||
In order to properly attach the correct trace with each log entry, a `context.Context` is required. | ||
If you're using logs combined with tracing, you should pass the correct context to properly attach each trace with the appropriate logs. |
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.
If you're using logs combined with tracing, you should pass the correct context to properly attach each trace with the appropriate logs. | |
When using logs with tracing, make sure to pass the correct context so each log is properly associated with its trace. |
### LogHook | ||
|
||
Use `sentrylogrus.NewLogHook()` to send structured logs to Sentry. This hook captures log entries and sends them to Sentry's structured logging system. | ||
You have two ways to create a new `LogHook`. Either by using `sentrylogrus.NewLogHook()` and passing the `sentry.ClientOptions` or |
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.
You have two ways to create a new `LogHook`. Either by using `sentrylogrus.NewLogHook()` and passing the `sentry.ClientOptions` or | |
You have two ways to create a new `LogHook`. Either by using `sentrylogrus.NewLogHook()` and passing the `sentry.ClientOptions`, or |
``` | ||
|
||
### EventHook | ||
|
||
Use `sentrylogrus.NewEventHook()` to send log entries as Sentry events. This is useful for error tracking and alerting. | ||
You also have two ways to create a new `EventHook`. Either by using `sentrylogrus.NewEventHook()` and passing the `sentry.ClientOptions` or |
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.
You also have two ways to create a new `EventHook`. Either by using `sentrylogrus.NewEventHook()` and passing the `sentry.ClientOptions` or | |
You also have two ways to create a new `EventHook`. Either use `sentrylogrus.NewEventHook()` and passing the `sentry.ClientOptions`, or |
"github.com/getsentry/sentry-go" | ||
sentryslog "github.com/getsentry/sentry-go/slog" | ||
) | ||
To integrate Sentry with slog, you need to set up a Sentry handler and configure the Sentry client. |
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.
To integrate Sentry with slog, you need to set up a Sentry handler and configure the Sentry client. | |
To integrate Sentry with slog, you need to set up a Sentry handler and configure the Sentry client: |
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.
LGTM!
DESCRIBE YOUR PR
Changing the docs to adhere with the logging API signature changes in Go.