import {Fragment} from 'react';
import ExternalLink from 'sentry/components/links/externalLink';
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';
// 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: ,
}
);
export const steps = ({
dsn,
}: {
dsn?: string;
} = {}): LayoutProps['steps'] => [
{
type: StepType.INSTALL,
description: t(
"Install Sentry's integration with Log4j 2.x using either Maven or Gradle:"
),
configurations: [
{
description:
{tct(
'The following example using the [log4j2Code:log4j2.xml] format to configure a [sentryAppenderCode:ConsoleAppender] that logs to standard out at the INFO level, and a [code:SentryAppender] that logs to the Sentry server at the ERROR level.',
{log4j2Code: , 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." )}