> For the complete documentation index, see [llms.txt](https://docs.hamina.com/hamina/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hamina.com/hamina/onsite/logs.md).

# Collecting Hamina Onsite Logs

While very rare, we might need you to collect some logs from Hamina Onsite to troubleshoot connection or site survey issues.

### Collecting Logs

{% hint style="info" %}
When collecting logs from an iOS device, note:

* Connect the iOS device to a Mac with cable and keep the screen unlocked.
* Ensure the iOS device name doesn’t include special characters because it can cause the log collection to fail. For example “Jussi´s iPhone” → “Jussis iPhone”.
* The device name can be changed from Settings → General → About → Name
  {% endhint %}

1. Open the terminal on Mac and switch to the folder where you want to store the log file. E.g:

   ```bash
   cd ~/Downloads
   ```
2. Collect the log file named \`onsite\_log.logarchive in the folder:

   ```bash
   sudo log collect --device-name "Jussi iPhone" --start "2024-02-06 11:45:00"  --output onsite_log.logarchive
   ```

{% hint style="info" %}

* `-device-name` must match your device’s name.
  * It’s only required when collecting logs from an iOS device. The logs are collected default from MacOS.
* `-start` specifies from what time the logs are collected.
  * The logs can be multiple gigabytes if collected over multiple days so it’s better to specify the time just before the issue happened.
  * The date format might depend on the OS. Run the command `sudo log collect --help` to see all the available options and the date format.
* `-output` specifies the log file name.
  {% endhint %}

### Converting Logs to a Smaller Text File

The log collection command doesn’t have an end date filter, and the logs contain a lot of other apps and OS log messages that we are not interested in. The logs can be filtered on the command line with the `log show` command to include only Onsite logs in a specific time interval:

```
log show --debug --info --start '2024-05-17 08:00:00' --end '2024-05-17 09:00:00' --process 'Hamina Onsite' onsite_log.logarchive > onsite_log.txt
```

This will create a text file onsite\_log.txt that contains only the Onsite app logs.

{% hint style="info" %}
The date format might differ in different operating systems. Use the command `log show --help` to check the date format.
{% endhint %}

{% hint style="info" %}
Change the argument `--process 'Hamina Onsite'` to `--process 'Hamina Onsite Test` if the log archive is from the Test app.
{% endhint %}


---

# 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.hamina.com/hamina/onsite/logs.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.
