---
title: "Record User Information"
description: "Learn about how you can record or customize the capture of user information."
url: https://docs.sentry.io/platforms/java/guides/spring-boot/record-user/
---

# Record User Information | Sentry for Spring Boot

Recording user information is available only in the Spring MVC integration.

Record user information from an HTTP request or by registering a Spring bean for custom user information capture.

## [Recording User Information From HTTP Request](https://docs.sentry.io/platforms/java/guides/spring-boot/record-user.md#recording-user-information-from-http-request)

To record the user's IP address and `Principal#name` as the username, set the personal information flag to `true`.

```properties
sentry.send-default-pii=true
```

## [Recording Custom User Information](https://docs.sentry.io/platforms/java/guides/spring-boot/record-user.md#recording-custom-user-information)

To record custom user information, you can register a bean that implements `SentryUserProvider` interface.

```java
import org.springframework.stereotype.Component;
import io.sentry.protocol.User;
import io.sentry.spring.SentryUserProvider;

@Component
class CustomSentryUserProvider implements SentryUserProvider {
  public User provideUser() {
    User user = new User();
    // ... set user information
    return user
  }
}
```
