# Investigate an app session

Connect application logs, events, handled errors, and lifecycle context to understand what happened during a user's session.

Source: https://appportal.io/docs/guides/investigate-session

Start with a session from your app. Follow its lifecycle and navigation, then use logs, handled
errors, and custom events to understand the work performed during that run.

## Let the SDK supply lifecycle context

Initialize the SDK in native startup. Apple, Android and supported .NET native platforms observe
lifecycle automatically, including when MAUI or Uno supplies the UI. Framework DI registers the
existing client. Sessions receive foreground/background context and active time without application
lifecycle forwarding or custom business events for every pause or resume.

Attach the framework navigation observer where your .NET app uses one; otherwise record screen
changes through your SDK's screen API. Use manual timings only for work the SDK cannot measure.
Flutter currently requires manual screen and timing instrumentation and does not observe host
lifecycle transitions automatically. Native .NET observation covers Windows, macOS, Linux/X11 and
BrowserWasm; Linux framebuffer remains a current limitation. Check your framework guide for its
capture and delivery guarantees.

No SDK can depend on receiving a final callback when the operating system kills a process or a
browser tab closes. Missing end-of-session data does not by itself establish that the app crashed.

## Instrument one real workflow

Choose a small flow, such as refreshing a catalog. Record a log when refresh starts, an event when
it succeeds, and an exception when your code catches a failure. Keep the normal recovery behavior,
such as displaying cached data. Use a short operation name to make related messages easy to find.

Your SDK guide shows the capture APIs:

- [.NET: get the client, log, and capture managed exceptions](https://appportal.io/docs/sdks/dotnet/telemetry).
- [Apple: logs and handled Swift errors](https://appportal.io/docs/sdks/apple#add-your-own-events-and-logs).
- [Android: logs and handled exceptions](https://appportal.io/docs/sdks/android#add-your-own-events-and-logs).
- [Flutter: logs and Dart errors with stack traces](https://appportal.io/docs/sdks/flutter#add-logs-and-report-handled-errors).

Events are countable product outcomes. Logs are searchable diagnostic messages. Captured errors
include exception details and available stack traces. Breadcrumbs provide a short lead-up to an
error report. You do not need to represent every action in all four forms.

## Reproduce and find the run

With consent granted, exercise the flow in your test app. Include a successful refresh and a
recoverable failure. On a supported host, also background and resume the app.

1. Select the app, environment, and test time range in the Dashboard.
2. Open **Sessions**, choose the run, and open its **Session story**.
3. Read the **Timeline** with the available lifecycle, screen, network, event, and error context.
   Logs help explain what the code did between the user's action and its outcome.
4. Open **Logs** for message-level filtering or **Crashes** for error details and available stack
   traces. Keep the same app, environment, and time scope across these views.

Records from one client carry its session ID automatically. You do not need to pass your own
session ID with every capture call. Use an opaque app user ID when identifying a signed-in user,
and clear it on sign-out so later activity is not attributed to the wrong person.

Telemetry delivery and processing happen asynchronously. If part of the run is missing, check
[consent and delivery](https://appportal.io/docs/concepts/reliable-delivery), the selected scope, and the SDK's platform
limits. Upload matching build symbols when release stacks need symbolication.

To review usage and stability across runs, [build and share a BI dashboard](https://appportal.io/docs/guides/build-a-bi-dashboard).
