# Logs

{% hint style="info" %}
Users have the ability to view the log of activities that the system maintains, which records all actions performed by each user.
{% endhint %}

{% tabs %}
{% tab title="Navigation to Logs" %}

* Login as an Admin > System > Logs\ <br>

  <figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2F8e900mgwCdzPH8Z4oSqv%2Fimage.png?alt=media&#x26;token=a094bbcc-75da-4ed9-9946-fcb2d39802e6" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Functionality" %}

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FdIMHSJEFN3BV6e5Cpi1p%2Fimage.png?alt=media&#x26;token=7e24bad0-d7b1-4f5b-afaa-c82ff242e18f" alt=""><figcaption></figcaption></figure>

If the toggle filter is enabled, users can filter the activity log specifically by the salesperson.&#x20;

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2Fg8kcViutXWarl9wpDAkQ%2Fimage.png?alt=media&#x26;token=dedb0de0-d8e7-4d5d-b23a-98f643968277" alt=""><figcaption></figcaption></figure>

Additionally, users can search through the logs using a regular grid search function. Users have the ability to sort the logs based on each column.

<figure><img src="https://1721684721-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPaF9cGX0SlYrvgRNs9Wi%2Fuploads%2FuAnMpE82JtCRwGtErwGy%2Fimage.png?alt=media&#x26;token=bdabec54-dc38-4a5c-8294-c34838041fcf" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Database tables & queries" %}
Here are the database tables related to logs:

* users
* activities
* jobs
* job\_types

### Queries

***Used left join query with above mention tables***

```sql
$logs = Activity::leftJoin('users', 'activities.user_id', '=', 'users.id')
->leftJoin('jobs', 'activities.job_id', '=', 'jobs.id')
->leftJoin('job_types', 'jobs.job_type_id', '=', 'job_types.id')
->select(['subject', 'activities.as_at', 'users.name as user', 'url', 'jobs.id as jobs_id', 'jobs.address as job_address' , 'job_types.name as job_type_name']);
```

{% endtab %}

{% tab title="Paths" %}

### Function Path&#x20;

```
app/Helpers/ActivityHelper.php -> log()
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://skaleptyltd.gitbook.io/build-solution/product-guides/system/logs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
