import {Fragment} from 'react'; import ExternalLink from 'sentry/components/links/externalLink'; import Link from 'sentry/components/links/link'; import {Layout, LayoutProps} from 'sentry/components/onboarding/gettingStartedDoc/layout'; import {ModuleProps} from 'sentry/components/onboarding/gettingStartedDoc/sdkDocumentation'; import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step'; import {t, tct} from 'sentry/locale'; interface StepsParams { dsn: string; organizationSlug?: string; projectSlug?: string; sourcePackageRegistries?: ModuleProps['sourcePackageRegistries']; } // Configuration Start const introduction = (
{tct(
'The [code:sentry-log4j2] library provides [log4jLink:Log4j 2.x] support for Sentry via an [appenderLink:Appender] that sends logged exceptions to Sentry.',
{
log4jLink: ,
}
)}
{tct( 'To see source context in Sentry, you have to generate an auth token by visiting the [link:Organization Auth Tokens] settings. You can then set the token as an environment variable that is used by the build plugins.', { link: , } )}
), language: 'bash', code: ` SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___ `, }, { description:
{tct(
'The [link:Sentry Gradle Plugin] automatically installs the Sentry SDK as well as available integrations for your dependencies. Add the following to your [code:build.gradle] file:',
{
code: ,
link: (
{tct(
'The following example using the [log4j2Code:log4j2.xml] format to configure a [sentryConsoleAppenderCode:ConsoleAppender] that logs to standard out at the INFO level, and a [sentryAppenderCode:SentryAppender] that logs to the Sentry server at the ERROR level.',
{
log4j2Code: ,
sentryConsoleAppenderCode:
,
sentryAppenderCode:
,
}
)}
{tct(
"You'll also need to configure your DSN (client key) if it's not already in the [code:log4j2.xml] configuration. Learn more in [link:our documentation for DSN configuration].",
{
code: ,
link: (
{tct(
"Next, you'll need to set your log levels, as illustrated here. You can learn more about [link:configuring log levels] in our documentation.",
{
link: (
{t( "If you're new to Sentry, use the email alert to access your account and complete a product tour." )}
{t( "If you're an existing user and have disabled alerts, you won't receive this email." )}