> 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

A Support Application 6 feature that collects device logs and uploads them for remote troubleshooting.

## Overview

Log Collection and Submission 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. This allows a help-desk ticket to include real log data without physically retrieving the device.

By default, log-file submission is disabled.

## User Guide

To configure Log Collection and Submission, complete the following steps:

1. Set `submitLogs.enabled` to `true` to enable log-file submission.
2. Configure the upload destination: set `logUrl` for a host URL, `loggingConnection` and `loggingContainer` for Azure Blob Storage, or `splunkApiLogPath` and `splunkLogAuth` for Splunk log uploads.
3. Optionally enable scheduled uploads by setting `submitLogs.alarmEnabled` to `true` and configuring `submitLogs.multipleHoursOfDayToSend`.
4. Optionally enable boot-time uploads by setting `submitLogs.sendOnBoot` to `true`.
5. Configure `submitLogs.directories[]` to specify per-app log file globs to collect.
6. If using Zebra RxLogger or Honeywell HxLogger, set `rxLogger.loggingDuration` to control how long logging stays enabled before auto-revert.

## Configuration

### Enabling Log Submission

To enable log-file submission, set `submitLogs.enabled` to `true`:

```json
"bfSupportAgent": {
"submitLogs": {
  "enabled": true
}
}
```

### Configuring the Upload Destination

Set `logUrl` for a host URL, or `loggingConnection` and `loggingContainer` for Azure Blob Storage:

```json
"bfSupportAgent": {
"logUrl": "https://log.example.com/upload",
"loggingConnection": "azure-connection-string",
"loggingContainer": "log-container"
}
```

To upload logs to Splunk, set `splunkApiLogPath` and `splunkLogAuth`:

```json
"bfSupportAgent": {
"splunkApiLogPath": "services/collector/raw",
"splunkLogAuth": "your-splunk-log-token"
}
```

### Configuring Scheduled Uploads

To enable scheduled (alarm-driven) log uploads, set `submitLogs.alarmEnabled` to `true` and specify the hours to run:

```json
"bfSupportAgent": {
"submitLogs": {
  "enabled": true,
  "alarmEnabled": true,
  "multipleHoursOfDayToSend": "0,6,12,18"
}
}
```

### Configuring Boot-Time Uploads

To upload logs on device boot, set `submitLogs.sendOnBoot` to `true`:

```json
"bfSupportAgent": {
"submitLogs": {
  "enabled": true,
  "sendOnBoot": true
  }
}
```

### Configuring Log Directories

Set `submitLogs.directories[]` to specify per-app log file globs to collect. Each entry includes application, location, files (regex), and an optional extractor (currently only `rxloggercsv` is supported):

```json
"bfSupportAgent": {
"submitLogs": {
  "enabled": true,
  "directories": [
    {
      "application": "com.example.app",
      "location": "/sdcard/logs/",
      "files": ".*\\.log",
      "extractor": "rxloggercsv"
    }
  ]
}
}
```

### Configuring RxLogger/HxLogger Auto-Revert

Set `rxLogger.loggingDuration` to the number of minutes RxLogger or HxLogger stays enabled before auto-revert:

```json
"bfSupportAgent": {
"rxLogger": {
"loggingDuration": 30
  }
}
```

This table provides the settings for the Log Collection and Submission feature.

| 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                                                                                                                |

### Troubleshooting

If you encounter issues with Log Collection and Submission, check the following:

#### **Log submission reports SavedLocally unexpectedly.**

Resolution Steps:&#x20;

1. Check whether `logUrl`, `loggingConnection/loggingContainer`, or the Splunk log fields (`splunkApiLogPath`, `splunkLogAuth`) are populated in the effective config.
2. If none are set, this is expected behavior, not a bug - the zip will be in the device Downloads folder.

#### **RxLogger/HxLogger doesn't stop.**

Resolution Steps:

1. Ensure the `SCHEDULE_EXACT_ALARM` permission is granted. This is required for the auto-revert timer (`RevertSystemLoggerAlarmReceiver`) to fire.
2. Check whether the logging duration (`rxLogger.loggingDuration`) was configured or left at a default that is longer than expected.

## Putting It All Together

For the example described above, the full configuration for the Log Collection and Submission feature is as follows:

```json
"bfSupportAgent": {
"logUrl": "https://log.example.com/upload",
"loggingConnection": "azure-connection-string",
"loggingContainer": "log-container",
"splunkApiLogPath": "services/collector/raw",
"splunkLogAuth": "your-splunk-log-token",
"rxLogger": {
  "loggingDuration": 30
},
"submitLogs": {
  "enabled": true,
  "alarmEnabled": true,
  "sendOnBoot": false,
  "multipleHoursOfDayToSend": "0,6,12,18",
  "directories": [
    {
      "application": "com.example.app",
      "location": "/sdcard/logs/",
      "files": ".*\\.log",
      "extractor": "rxloggercsv"
    }
  ]
}
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bluefletch.com/bluefletch-enterprise/product-guides/support-application/sa-6/features/log-collection-and-submission.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
