---
title: Verify JRE Java SDK events
description: "Trace a JRE Java SDK event through each stage: what the SDK captured, how middleware transformed it, what it sent to Amplitude, and what Amplitude received."
product: analytics
lang: en
last_updated: 2026-12-01
token_estimate: 2282
---
# Verify JRE Java SDK events

An event moves through four stages between your `logEvent()` call and Amplitude's servers. Verify each stage in order. The first stage where the event looks wrong is where the problem is.

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

| Stage | Question | Where to look |
| --- | --- | --- |
| [Captured](#check-what-the-sdk-captured) | Did the SDK accept the call? | An inspection middleware |
| [Transformed](#check-how-middleware-transformed-the-event) | What did middleware add, change, or drop? | The same middleware, added last |
| [Sent](#check-what-the-sdk-sent) | Did the request leave the JVM, and with what? | Debug logs, or an intercepting HTTPS proxy |
| [Received](#check-what-amplitude-received) | Did Amplitude accept and store the event? | The upload callback, then _User Lookup_ in Amplitude |

For problems common to every Amplitude SDK, go to [SDK troubleshooting and debugging](https://amplitude.com/docs/sdks/sdk-debugging). If behavior changed after an SDK upgrade, check the [Java SDK changelog](https://github.com/amplitude/Amplitude-Java/blob/main/CHANGELOG.md).

## Turn on debug logging

Set the log level to `DEBUG` while you verify.

```java
Amplitude client = Amplitude.getInstance();
client.init("AMPLITUDE_API_KEY");
client.setLogMode(AmplitudeLog.LogMode.DEBUG);

client.logEvent(new Event("Sign Up Completed", "user-12345"));
```

The SDK logs only when it uploads or retries events. It prints nothing when you call `logEvent()`. Each message has the form `<tag>: <message>`. `DEBUG` and `WARN` messages go to standard output, and `ERROR` messages go to standard error.

| Tag | Level | When |
| --- | --- | --- |
| `SEND` | `DEBUG` | After an upload, with the number of events in it: `SEND: Events count 1`. |
| `RETRY` | `DEBUG` | After a retry, with the number of events in it. At `ERROR`, a retry thread failed. |
| `RESPONSE` | `DEBUG` | After `SEND` or `RETRY`, with the response as JSON. |
| `DROP EVENTS` | `WARN` | The retry buffer held 16,000 events, so the SDK dropped events instead of retrying them. |
| `Flush Thread Error` | `ERROR` | An upload failed with an exception, followed by its stack trace. |
| `Error event payload` | `ERROR` | After `Flush Thread Error`, with the events of the failed upload. |

A successful upload logs this:

```text
SEND: Events count 1
RESPONSE: {
    "code": 200,
    "successBody": {
        "serverUploadTime": 1794340064240,
        "payloadSizeBytes": 412,
        "eventsIngested": 1
    },
    "status": "SUCCESS"
}
```

The SDK doesn't log the API key. `Error event payload` lines contain event data, so return the level to `ERROR` before you deploy.

## Check what the SDK captured

The SDK has no log for `logEvent()`. To see each event as `logEvent()` receives it, add a middleware that prints it and passes it on:

```java
Amplitude client = Amplitude.getInstance();
client.init("AMPLITUDE_API_KEY");

client.addEventMiddleware((payload, next) -> {
  System.out.println("Amplitude event: " + payload.event);
  next.run(payload);
});

Event event = new Event("Sign Up Completed", "user-12345");
event.addEventProperty("plan", "starter");
client.logEvent(event);
```

The middleware prints the event as JSON, with the same fields the SDK uploads:

```json
{
  "event_type": "Sign Up Completed",
  "user_id": "user-12345",
  "device_id": null,
  "event_properties": { "plan": "starter" },
  "user_properties": {},
  "groups": {},
  "group_properties": {},
  "session_id": -1,
  "event_id": 0,
  "location_lat": 0,
  "location_lng": 0,
  "library": "amplitude-java/1.13.1"
}
```

Check the output for these problems:

| What you see | What it means |
| --- | --- |
| No line for the event | The call never ran, or a middleware added earlier didn't call `next` and dropped the event. |
| `user_id` and `device_id` both `null` | Not possible: the `Event` constructor throws first. If either ID is a placeholder, such as an empty string, Amplitude rejects the event or attributes it wrongly. |
| `session_id` is `-1` | Expected. The SDK doesn't track sessions. Go to [Attach a session ID](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/instrument-and-configure#attach-a-session-id). |
| `location_lat` and `location_lng` are `0` | Expected. The SDK sends both fields on every event, with `0` when you don't set them. |

## Check how middleware transformed the event

Middleware runs in the order you added it. To see the event after your other middleware changed it, add the inspection middleware last. A middleware that doesn't call `next.run(payload)` drops the event: it never reaches the queue, and no callback runs for it.

The SDK adds no fields in middleware. Before the first middleware runs, it adds the instance's [`Plan`](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/reference#plan) and [`IngestionMetadata`](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/reference#ingestionmetadata) to events that have none. It adds `library` when it builds the upload.

## Check what the SDK sent

A server process has no _Network_ tab. The upload body is a JSON object with `api_key`, `events` (each event's `toJsonObject()`), and `options` when you set [`Options`](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/reference#options). The SDK doesn't compress it.

- **Count**: at `DEBUG` level, `SEND: Events count N` confirms that an upload ran and how many events it held.
- **Content**: the inspection middleware prints what each event contributes to the body.
- **Raw request**: the SDK sends only over HTTPS, so a plain local HTTP server can't receive it. Run an intercepting HTTPS proxy, point the SDK at it with [`setProxy()`](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/instrument-and-configure#route-uploads-through-an-http-proxy), and add the proxy's certificate to the JVM's trust store.

If no `SEND` line appears, the upload didn't run. The usual cause is a program that ends before the next scheduled upload. Go to [Flush and shut down](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/instrument-and-configure#flush-and-shut-down).

## Check what Amplitude received

### Read the upload result

The SDK reports the result for each event to callbacks. Set a callback while you verify:

```java
Amplitude client = Amplitude.getInstance();
client.init("AMPLITUDE_API_KEY");
client.setCallbacks(new AmplitudeCallbacks() {
  @Override
  public void onLogEventServerResponse(Event event, int status, String message) {
    System.out.println(event.eventType + ": " + status + " " + message);
  }
});

client.logEvent(new Event("Sign Up Completed", "user-12345"));
```

A successful upload prints `Sign Up Completed: 200 Event sent success.`

| `status` | `message` | What happened |
| --- | --- | --- |
| `200` | `Event sent success.` | Amplitude accepted the event on the first attempt. |
| `200` | `Events sent success.` | Amplitude accepted the event on a retry. |
| `400` | Amplitude's error, such as `Request missing required field` | Amplitude rejected the request or this event. The SDK retries the other events in the request. |
| `413` | `Event dropped for retry` | The request was too large. The SDK dropped this event, which was in the second half of the batch, and retried the first half. |
| `429` | Amplitude's error, such as `Too many requests for some devices and users` | The event's user or device is over its daily quota. The SDK retries events for other users and devices. |
| `408`, `500`–`599` | `Event retries exhausted.` | The request timed out, failed on the network, or got a server error on all 12 retries. |
| `0` | `Error sending events due to the exception: ...` | The upload failed with an exception: an invalid API key (`AmplitudeInvalidAPIKeyException`), an `http://` server URL, or a [flush timeout](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/instrument-and-configure#set-a-flush-timeout) (`TimeoutException`). |
| `0` | `Client shutdown. Events not retry.` | You called `shutdown()` while the event waited for a retry. |
| `0` | `Retry threads Exception.` | A retry thread failed. The debug log shows a `RETRY` error with the stack trace. |
| Any | `Retry buffer is full(N), M events dropped.` | 16,000 events already waited for a retry. Slow down your `logEvent()` calls with [`shouldWait()`](https://amplitude.com/docs/sdks/analytics/java/jre-java-sdk/reference#shouldwait). |

Events dropped by middleware, and events still in the queue when you call `shutdown()` without `flushEvents()`, get no callback.

### Find the event in Amplitude

1. In Amplitude, open **User Lookup** and search for the user ID or device ID of the event.
2. Open the **Activity** tab and turn on **Live event updates**.
3. Confirm that the event appears with the properties you set.

If the callback reported `200` but the event doesn't appear, check that the API key belongs to the project you're looking at, and that the server URL matches the project's data center.

