> For the complete documentation index, see [llms.txt](https://docs.autopilotmonitor.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autopilotmonitor.com/troubleshooting-and-support/diagnostics-and-log-collection.md).

# Diagnostics & Log Collection

## The diagnostics package

When enabled, the agent bundles the relevant device logs into a ZIP at the end of enrollment and uploads it — so the evidence is already waiting when you open a failed session (**Download Diagnostics** button on the session detail page).

Configuration lives under **Settings → Agent → Diagnostics Package** ([full reference](/reference/settings.md#diagnostics-package)):

* **Upload destination** — your own Azure Blob Storage (Container SAS URL; data never leaves your tenant) or the built-in hosted storage (short-lived, write-only upload tokens; no storage account needed).
* **Upload Mode** — `Always`, `On Failure Only` (recommended), or `Off`.
* **Additional Log Paths** — extend the default collection with your own files: wildcards in the last path segment, environment variables, and the `%LOGGED_ON_USER_PROFILE%` token for user-profile logs (limited to `AppData\Local`/`Roaming`), optionally with subfolders. Paths are validated against an agent-side allow-list of known log locations.

The default package already covers the essentials: agent logs, IME logs, Panther setup logs, SetupDiag, event logs, and related locations.

## The agent's own log

`%ProgramData%\AutopilotMonitor\Logs` on the device records the agent's startup, guard decisions, collection activity, and every backend interaction. Two settings matter when hunting an agent problem:

* **Keep Log File** — preserves the log through self-destruct.
* **Log Level** — raise to Debug/Verbose only while diagnosing; remember it applies to new enrollments.

For suspected IME-pattern issues there is a dedicated **IME Pattern Match Log** ([details](/rules/ime-log-patterns.md#contributing-patterns)).

## Reporting a session

The **Report Session** action on any session detail page sends a report including your comment and contact address, with optional screenshot and agent-log attachments — the session's timeline exports are attached automatically. Use it when you believe the *product* got something wrong (misclassified session, missing events, a rule misfiring); use the diagnostics package when you're troubleshooting *your* enrollment.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.autopilotmonitor.com/troubleshooting-and-support/diagnostics-and-log-collection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
