Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 45 additions & 17 deletions docs/platforms/java/common/index.mdx
Original file line number Diff line number Diff line change
@@ -1,41 +1,69 @@
<PlatformContent includePath="getting-started-primer" />

On this page, we get you up and running with Sentry's SDK.
<PlatformContent includePath="getting-started-prerequisites" />

<PlatformSection notSupported={["java.spring", "java.spring-boot"]}>
<PlatformContent includePath="alert-using-a-framework" noGuides />
</PlatformSection>

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.
<StepConnector selector="h2" showNumbers={true}>

## Install

Sentry captures data by using an SDK within your application’s runtime.
Install the Sentry SDK for your Java logging framework or application:

<PlatformContent includePath="getting-started-install" />

<PlatformContent includePath="getting-started-install/opentelemetry" />

## Configure

<PlatformContent includePath="getting-started-config" />
**Error Monitoring** starts once Sentry is configured. **Application Metrics** need no extra configuration, and you'll learn how to send them in step [#4](#send-application-metrics-). This guide also configures **Tracing**, **Logs**, and **Profiling**.

<Include name="quick-start-features-expandable" />

Don't need a feature? Remove its configuration from the SDK initialization. To disable Profiling, also remove the `sentry-async-profiler` dependency. Profiling is not supported on Windows.

### With OpenTelemetry

<PlatformContent includePath="getting-started-config/opentelemetry" />

## Verify
See the [agent setup guide](/platforms/java/opentelemetry/setup/agent/) or [agentless setup guide](/platforms/java/opentelemetry/setup/agentless/) for details.

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
### Without OpenTelemetry

<PlatformContent includePath="getting-started-verify" />
<PlatformContent includePath="getting-started-config" />

## Send Logs

<PlatformContent includePath="getting-started-logs" />

We also provide integrations for:
- [Logback](/platforms/java/guides/logback/logs/)
- [Log4j2](/platforms/java/guides/log4j2/logs/)
- [java.util.logging](/platforms/java/guides/jul/logs/)

<Alert>
## Send Application Metrics <FeatureBadge type="new" />

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.
<PlatformContent includePath="getting-started-metrics" />

</Alert>
## Verify Your Setup

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.

Add this intentional error to your application:

<PlatformContent includePath="getting-started-verify" />

### View Captured Data in Sentry

Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).

<Include name="quick-start-locate-data-expandable" />

## Next Steps

- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup

</StepConnector>

<Expandable permalink={false} title="Are you having problems setting up the SDK or integration?">

- Find various topics in <PlatformLink to="/troubleshooting/">Troubleshooting</PlatformLink>
- [Get support](https://www.sentry.help/en/)

</Expandable>
1 change: 1 addition & 0 deletions docs/platforms/java/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
title: Java
description: "Learn how to set up Sentry in your Java application and capture your first events."
caseStyle: camelCase
supportLevel: production
sdk: sentry.java
Expand Down
4 changes: 0 additions & 4 deletions docs/platforms/java/guides/jul/config.yml

This file was deleted.

54 changes: 54 additions & 0 deletions docs/platforms/java/guides/jul/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: java.util.logging
description: "Learn how to set up Sentry's JUL integration to capture logs."
caseStyle: camelCase
supportLevel: production
sdk: sentry.java.jul
---
<PlatformContent includePath="getting-started-primer" />

<PlatformContent includePath="getting-started-prerequisites" />

<StepConnector selector="h2" showNumbers={true}>

## Install

Add the `sentry-jul` dependency to your project:

<PlatformContent includePath="getting-started-install" />

## Configure

<PlatformContent includePath="getting-started-config" />

## Verify Your Setup

To verify that the integration is working, log an error through JUL:

```java
import java.util.logging.Level;
import java.util.logging.Logger;

Logger logger = Logger.getLogger("example");
logger.log(Level.SEVERE, "This is a test.", new Exception("This is a test."));
```

### View Captured Data in Sentry

Now, open the [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) page and filter by service, environment, or search keywords to view log entries from your application (it takes a couple of moments for the data to appear).

## Next Steps

- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup
- Learn more about <PlatformLink to="/logs/">setting up logging</PlatformLink>
- Learn how to [send application metrics](/platforms/java/metrics/) and [traces](/platforms/java/tracing/)
- Configure [profiling](/platforms/java/profiling/) to capture performance data from your application

</StepConnector>

<Expandable permalink={false} title="Are you having problems setting up the SDK or integration?">

- Find various topics in <PlatformLink to="/troubleshooting/">Troubleshooting</PlatformLink>
- [Get support](https://www.sentry.help/en/)

</Expandable>
4 changes: 0 additions & 4 deletions docs/platforms/java/guides/log4j2/config.yml

This file was deleted.

54 changes: 54 additions & 0 deletions docs/platforms/java/guides/log4j2/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Log4j 2.x
description: "Learn how to set up Sentry's Log4j 2.x integration to capture logs."
caseStyle: camelCase
supportLevel: production
sdk: sentry.java.log4j2
---
<PlatformContent includePath="getting-started-primer" />

<PlatformContent includePath="getting-started-prerequisites" />

<StepConnector selector="h2" showNumbers={true}>

## Install

Add `sentry-log4j2` to your project (Maven Plugin and Gradle Plugin automatically add integrations for you):

<PlatformContent includePath="getting-started-install" />

## Configure

<PlatformContent includePath="getting-started-config" />

## Verify Your Setup

To verify that the integration is working, log an error through Log4j2:

```java
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Logger logger = LogManager.getLogger("example");
logger.error("This is a test log message");
```

### View Captured Data in Sentry

Now, open the [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) page and filter by service, environment, or search keywords to view log entries from your application (it takes a couple of moments for the data to appear).

## Next Steps

- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup
- Learn more about <PlatformLink to="/logs/">setting up logging</PlatformLink>
- Learn how to [send application metrics](/platforms/java/metrics/) and [traces](/platforms/java/tracing/)
- Configure [profiling](/platforms/java/profiling/) to capture performance data from your application

</StepConnector>

<Expandable permalink={false} title="Are you having problems setting up the SDK or integration?">

- Find various topics in <PlatformLink to="/troubleshooting/">Troubleshooting</PlatformLink>
- [Get support](https://www.sentry.help/en/)

</Expandable>
4 changes: 0 additions & 4 deletions docs/platforms/java/guides/logback/config.yml

This file was deleted.

54 changes: 54 additions & 0 deletions docs/platforms/java/guides/logback/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Logback
description: "Learn how to set up Sentry's Logback integration to capture logs."
caseStyle: camelCase
supportLevel: production
sdk: sentry.java.logback
---
<PlatformContent includePath="getting-started-primer" />

<PlatformContent includePath="getting-started-prerequisites" />

<StepConnector selector="h2" showNumbers={true}>

## Install

Add `sentry-logback` to your project (Maven Plugin and Gradle Plugin automatically add integrations for you):

<PlatformContent includePath="getting-started-install" />

## Configure

<PlatformContent includePath="getting-started-config" />

## Verify Your Setup

To verify that the integration is working, log an error through Logback:

```java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Logger logger = LoggerFactory.getLogger("example");
logger.error("This is a test.", new Exception("This is a test."));
```

### View Captured Data in Sentry

Now, open the [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) page and filter by service, environment, or search keywords to view log entries from your application (it takes a couple of moments for the data to appear).

## Next Steps

- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup
- Learn more about <PlatformLink to="/logs/">setting up logging</PlatformLink>
- Learn how to [send application metrics](/platforms/java/metrics/) and [traces](/platforms/java/tracing/)
- Configure [profiling](/platforms/java/profiling/) to capture performance data from your application

</StepConnector>

<Expandable permalink={false} title="Are you having problems setting up the SDK or integration?">

- Find various topics in <PlatformLink to="/troubleshooting/">Troubleshooting</PlatformLink>
- [Get support](https://www.sentry.help/en/)

</Expandable>
1 change: 1 addition & 0 deletions docs/platforms/java/guides/servlet/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
title: Servlet
description: Learn how to set up Sentry in your Servlet-based Java application and capture your first events.
caseStyle: camelCase
supportLevel: production
sdk: sentry.java.servlet
4 changes: 0 additions & 4 deletions docs/platforms/java/guides/spring-boot/config.yml

This file was deleted.

52 changes: 39 additions & 13 deletions docs/platforms/java/guides/spring-boot/index.mdx
Original file line number Diff line number Diff line change
@@ -1,43 +1,69 @@
---
title: "Spring Boot"
description: "Learn how to use Sentry's Spring Boot SDK."
description: "Learn how to set up Sentry in your Spring Boot application and capture your first events."
sdk: sentry.java.spring-boot
caseStyle: camelCase
supportLevel: production
---

<PlatformContent includePath="getting-started-primer" />

On this page, we get you up and running with Sentry's SDK.
<PlatformContent includePath="getting-started-prerequisites" />

Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.
<StepConnector selector="h2" showNumbers={true}>

## Install

Sentry captures data by using an SDK within your application’s runtime.
Install Sentry for your Spring Boot version:

<PlatformContent includePath="getting-started-install" />

<PlatformContent includePath="getting-started-install/opentelemetry" />

## Configure

**Error Monitoring** starts once Sentry is configured. **Application Metrics** need no extra configuration, and you'll learn how to send them in step [#4](#send-application-metrics-). This guide also configures **Tracing**, **Logs**, and **Profiling**.

<Include name="quick-start-features-expandable" />

<PlatformContent includePath="getting-started-config" />

<PlatformContent includePath="getting-started-config/opentelemetry" />

## Verify
## Send Logs

This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
<PlatformContent includePath="getting-started-logs" />

<PlatformContent includePath="getting-started-verify" />
We also provide integrations for:
- [Logback](/platforms/java/guides/logback/logs/)
- [Log4j2](/platforms/java/guides/log4j2/logs/)
- [java.util.logging](/platforms/java/guides/jul/logs/)

## Send Application Metrics <FeatureBadge type="new" />

<PlatformContent includePath="getting-started-metrics" />

## Verify Your Setup

<Alert>
Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.

Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage documentation</PlatformLink>.
Add this intentional error to your application:

</Alert>
<PlatformContent includePath="getting-started-verify" />

### View Captured Data in Sentry

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
Now, head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).

<Include name="quick-start-locate-data-expandable" />

## Next Steps

- Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup

</StepConnector>

<Expandable permalink={false} title="Are you having problems setting up the SDK or integration?">

- Find various topics in <PlatformLink to="/troubleshooting/">Troubleshooting</PlatformLink>
- [Get support](https://www.sentry.help/en/)

</Expandable>
4 changes: 0 additions & 4 deletions docs/platforms/java/guides/spring/config.yml

This file was deleted.

Loading
Loading