# System log entries

The "**System Diagnostics"** section in MikoPBX is a tool for monitoring and analyzing the status of the telephone system. Using this section helps to promptly detect and eliminate technical problems, ensuring stable and efficient operation of MikoPBX.

Section location: "**Maintenance**" -> "**System log entries**"

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FXDmcXQlSJKEXMtcdUklX%2FLogsSection.png?alt=media&#x26;token=b842e31b-25d5-44e4-b506-7790ccbca44b" alt=""><figcaption><p>System logs section</p></figcaption></figure>

Contains 3 tabs: ***Show log*****,&#x20;*****System information*****,&#x20;*****Capturing network packets***.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FlyWYyRed6DHO8Ew943G9%2FThreeSection.png?alt=media&#x26;token=5dbac9cd-7c39-4134-ac1a-472e88cc0361" alt=""><figcaption><p>Three sections</p></figcaption></figure>

## Show log section <a href="#prosmotr_logov" id="prosmotr_logov"></a>

This section allows you to view log files for detailed analysis of PBX operations.

1. To start, select a **file**.
2. Set the **lines** for the number of lines to fetch.
3. Set the **offset** value to shift the selection.
4. Set the **filter** by entering a string to be included in the selection.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FSwMSBlxV32KykycEzLkE%2FShowLogSection.png?alt=media&#x26;token=58fe0772-2995-4526-ba76-492cbf91f2e9" alt=""><figcaption><p>"Show log" section</p></figcaption></figure>

The following options are available:

1. **Download** the selected log as a file ![](https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F84koSpzh2z3WzpGdgs3H%2Fsistem_logi_skachat.png?alt=media\&token=b9bb67b6-6804-4a8c-bdf9-4b05a53d00f0).
2. **Refresh** the log ![](https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F7Q1SeE3Stj0lIPQUcK9h%2Fsistem_logi_obnovit.png?alt=media\&token=77645631-dc91-47bb-bcb1-8df1b0725d42).
3. **Auto-refresh** the log ![](https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F1VhxpA58PMEXUrNHpZMj%2Fimage.png?alt=media\&token=22f8ab26-3282-48ed-80aa-2500b7bb7bde).

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fq77IWyuSQQ72HJDW9bVB%2Ffuilters.png?alt=media&#x26;token=034a9d8e-f6ce-441a-91ff-dcd916bdb8f9" alt=""><figcaption><p>Filters</p></figcaption></figure>

## Example: Call Analysis <a href="#primer_analiz_zvonka" id="primer_analiz_zvonka"></a>

Suppose you need to analyze an outgoing call to the number **74952293042**.

1. Select the log file **asterisk/verbose**.
2. Set the phone number **74952293042** as the filter.
3. Set the **limit** to a sufficient value, such as **2000**, to ensure all log entries are included.
4. In the last line of the log selection, find the identifier:

```php
[2023-03-18 16:28:17] VERBOSE[21654][C-0000000f] app_stack.c: Spawn extension (SIP-1676196499-22-outgoing, 74952293042, 13) exited non-zero on 'PJSIP/302-0000001a'
```

5. In this example, the ID = **C-0000000f**.
6. Repeat the log query but use the filter **C-0000000f** this time.
7. You will receive the entire log of the dialplan process.
8. The obtained data can be sent to technical support for further assistance.

## System Information <a href="#informacija_o_sisteme" id="informacija_o_sisteme"></a>

The tab displays the following information:

* Network settings
* CPU load
* RAM usage
* iptables settings

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fs8gXyEbdHeJ37qWiz3H4%2FsysInfoSection.png?alt=media&#x26;token=dd12d037-cd44-4ec5-bd05-80a80109d9be" alt=""><figcaption><p>System information section</p></figcaption></figure>

## Campuring network packets <a href="#zaxvat_logov" id="zaxvat_logov"></a>

This section allows you to perform a detailed analysis of errors in PBX operation.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FVHNLbA1BrSOND7JLRukg%2FcaptureSection.png?alt=media&#x26;token=5681c9ce-700e-4b1e-98a4-72d3400dbf52" alt=""><figcaption><p>"Computer network packets" section</p></figcaption></figure>

#### Capturing Network Packets

You can start capturing network packets passing through the network interface.

1. To start the process, press the **Start** button.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FY8Gng4XMEJysbLWdGDJn%2FstartButton.png?alt=media&#x26;token=a36e1c7a-9058-475a-96f6-d9a4b0332773" alt=""><figcaption><p>"Start" button</p></figcaption></figure>

2. Reproduce your issue: make a call or perform an action that causes the error or failure.
3. Press the **Stop and Download** button.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FeGVqUMAG0MjHu75wqQee%2FstopButton.png?alt=media&#x26;token=60b3981c-f003-4c40-bbd2-7500c9563e9d" alt=""><figcaption><p>"Stop" button</p></figcaption></figure>

The network packets will automatically be saved in the archive **MikoPBXLogs\_log-tcpdump-XXXXXXXXXX**. They should also automatically save in your browser's **Downloads** folder.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fe0LWNyBmdwLrQ8Bl6nJn%2Ffile.png?alt=media&#x26;token=b4fc53de-bd69-4ddb-b853-fc8407fb22a2" alt=""><figcaption><p>Logs file</p></figcaption></figure>

If you cannot find the archive in the **Downloads** folder, you can [connect to the PBX via WinSCP](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-winscp) and download it from the **/storage/usbdisk1/mikopbx/tmp** directory - the file will be **log-tcpdump-XXXXXXXXXX.zip**.

{% hint style="info" %}
You can use the search function in WinSCP by entering "**log-tcpdump\***" in the file name field and specifying the search directory as **"/storage"**&#x20;
{% endhint %}

#### **Download All System Logs**

You can download all system logs accumulated on the PBX. To do this, click the **Download All System Logs** button.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FCO6RdGovkXliUUYjdtNR%2FdnldAllSysLog.png?alt=media&#x26;token=263262d7-5223-4d34-b7bf-7df9aac13ee0" alt=""><figcaption><p>"Download all system logs" button</p></figcaption></figure>

The system logs will automatically be saved in the archive **MikoPBXLogs\_log-sys-XXXXXXXXXX.zip**. The logs should also automatically save in your browser's **Downloads** folder.\
You can also obtain this log archive from the **/storage/usbdisk1/mikopbx/tmp** directory by connecting to the PBX using WinSCP. The file will be **log-sys-XXXXXXXXXX.zip**.

{% hint style="warning" %}
**Be careful**! If there are many calls or heavy network "load" on the PBX, logs can take up a significant amount of disk space.
{% endhint %}

Other ways to collect logs:

* Using an [SSH client](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/connecting-to-a-pbx-using-ssh/putty)
* Using the [Wireshark utility](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/capturing-logs-from-pbx-using-wireshark)
* Using the [tcpdump application](https://docs.mikopbx.com/mikopbx/english/faq/troubleshooting/getting-logs-using-the-tcpdump-application)
