> For the complete documentation index, see [llms.txt](https://docs.bluefletch.com/bluefletch-enterprise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bluefletch.com/bluefletch-enterprise/product-guides/support-application/sa-6/features/log-collection-and-submission.md).

# Log Collection and Submission

#### Purpose

Gathers device and third-party application logs (including OEM diagnostic logger output) and uploads them to Azure Blob Storage and/or Splunk, or hands them off to sibling BlueFletch apps, so a help-desk ticket can include real log data without physically retrieving the device.

#### Location

* `workers/SubmitLogsWorker.kt` — orchestrates collection + upload.
* `data/collectors/CollectLogs.kt` — gathers third-party app logs.
* `utils/RxLoggerHandler.kt` — Zebra RxLogger control.
* `utils/HxLoggerHandler.kt` — Honeywell HxLogger control.
* `receivers/RevertSystemLoggerAlarmReceiver.kt` — auto-revert timer.
* `data/file/FileUploader.kt` — Azure Blob upload.

#### Responsibilities

* Zip collected log files (RxLogger/HxLogger capture files + registered third-party app logs).
* Upload the zip to Splunk (HEC) and/or Azure Blob Storage, per `loggingConnection/loggingContainer` config.
* If no host is configured, fall back to saving the zip to the device's Downloads folder.
* Broadcast an upload-request intent to sibling BlueFletch apps (`LogUploadReceiver`) so they can attach their own logs.
* Start/stop RxLogger (Zebra) or HxLogger (Honeywell) on request, and automatically revert (stop) logging after a scheduled window via `AlarmManager` (`RevertSystemLoggerAlarmReceiver`), so verbose OEM logging is never left running indefinitely.

#### Configuration

| Configuration                       | Type    | Default | Description                                                                                                                                     |
| ----------------------------------- | ------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| logUrl                              | String  | -       | Host URL used when submitting device application logs                                                                                           |
| loggingConnection                   | String  | -       | Azure Blob Storage connection string                                                                                                            |
| loggingContainer                    | String  | -       | Azure Blob Storage container name                                                                                                               |
| splunkApiLogPath                    | String  | -       | Splunk collector path for device log uploads (distinct from the event API path)                                                                 |
| splunkLogAuth                       | String  | -       | Splunk auth token used specifically for log submission                                                                                          |
| rxLogger.loggingDuration            | Integer | -       | Minutes RxLogger/HxLogger stays enabled before auto-revert                                                                                      |
| submitLogs.enabled                  | Boolean | false   | Enables log-file submission                                                                                                                     |
| submitLogs.alarmEnabled             | Boolean | false   | Enables scheduled (alarm-driven) log uploads                                                                                                    |
| submitLogs.sendOnBoot               | Boolean | false   | Upload logs on device boot                                                                                                                      |
| submitLogs.multipleHoursOfDayToSend | String  | -       | Comma-separated hours (0-23, device local time) to run scheduled uploads                                                                        |
| submitLogs.directories\[]           | Array   | -       | Per-app log file globs to collect: `application`, `location`, `files` (regex), optional `extractor` (currently only `rxloggercsv` is supported) |

#### Error Handling

| Scenario                                                                                    | Expected behavior                              | Recovery                                                                                                                                         |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| No `logUrl`/Azure/Splunk log destination configured                                         | Zip saved to Downloads folder (`SavedLocally`) | User/technician manually retrieves the file                                                                                                      |
| Network unavailable during upload                                                           | `NetworkFailure` result                        | Re-run submission when connectivity returns; no automatic background retry was found for this specific pipeline (unlike the generic event queue) |
| <p>HTTP error from destination<br>HttpError result<br>Check destination credentials/URL</p> | HttpError `result`                             | Check destination credentials/URL                                                                                                                |

#### Logging and Troubleshooting

**Problem: Log submission reports SavedLocally unexpectedly.**

Check:&#x20;

1. Are logUrl, `loggingConnection/loggingContainer`, or the Splunk log fields (`splunkApiLogPath`, `splunkLogAuth`) populated in the effective config?&#x20;
2. If none are set, this is expected behavior, not a bug — the zip will be in the device Downloads folder.

**Problem: RxLogger/HxLogger doesn't stop.**

Check:

1. Is `SCHEDULE_EXACT_ALARM` permission granted (required for `RevertSystemLoggerAlarmReceiver`)?&#x20;
2. Was the logging duration (`rxLogger.loggingDuration`) configured, or left at a default that's longer than expected?


---

# 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.bluefletch.com/bluefletch-enterprise/product-guides/support-application/sa-6/features/log-collection-and-submission.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.
