# Logging

#### What this page shows

Info before getting started

* Creating a logging channel
* Difference between mod logging and event logging

Mod logging

* What it is
* Moderation events

Event logging

* What it is
* Logging events
* Activating events
* Examples

## Info before getting started

### Creating a logging channel

> Before logging anything in your server, Hoppi must first have a logging channel.

To create a logging channel, use `;logging`. This will create a new logging channel called *hoppi-logging*. To turn an existing channel into your server's logging channel use `;loghere`. This will rename that channel to *hoppi-logging.*

### Difference between mod logging and event logging

> Moderation vs. Events

1. Mod logging occurs when the bot moderates your server (e.g. when Hoppi kicks a member).
2. Event logging occurs when the specified event is triggered (e.g. when a message is deleted).

## Mod logging

Mod logging (or moderation logging) is when Hoppi logs details about moderation activities, for example when someone uses Hoppi to kick another member. Hoppi will only log this if your server has a logging channel.

More info is in progress.

## Event Logging

Event logging is a Hoppi feature where when an event is triggered, if your server has that event activated, Hoppi will alert the server by sending a message into your server's logging channel.&#x20;

To see events that can be logged, click the link below.

{% hint style="success" %}
[Events](https://hoppi-discord.gitbook.io/hoppi-docs/moderation/logging/events)
{% endhint %}

{% hint style="danger" %}
**Warning:** Events can only be triggered by users using the Discord App. They will not be triggered by users using the web browser version of Discord.
{% endhint %}

To see the events that your server has activated, use `;help logging`. Activated events will have a green square and deactivated events will have a red square.

If a category is activated, all events within it will be green as well.

## Activating Events

{% hint style="info" %}
To deactivate an event, use the **exact** same command. Hoppi will toggle the event for you, so you do **not** need to add a true or false at the end of your command. Once you use the command, Hoppi will say that event was either activated or deactivated.
{% endhint %}

Now that you know how logging works, these are ways you can activate events:

1. To activate a single event, use `;log <event>`.&#x20;
2. All events are in categories, so to activate all events in a category, Hoppi makes it simple for you. Simply use `;log <category>` and all those events will be activated

## Example

For example, I want to know when an invite is created in my server. To activate the `invitecreate` event, I would use **`;log invitecreate`.**

Hoppi would respond with: `The event`` `**`invitecreate`**` ``has been activated.`

If I already had the event invitecreate activated, Hoppi would respond with&#x20;

`The event`` `**`invitecreate`**`has been deactivated.`

as the event is already activated, so Hoppi will toggle it and deactivate it.\ <br>

Anyway, now that I have the invitecreate event activated, when someone creates an invite, Hoppi will alert me and send a message in my *hoppi-logging* channel.

![Invite creation log](https://1652376957-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MEOtU6zNe8v2p5AJQ5h%2F-MEPAeanPu4-PaqqdBcU%2F-MEPM-z4G1_Zynik79YM%2FScreenshot%20\(39\).png?alt=media\&token=513a8d85-270d-49ac-b11c-5da6fe177110)

The message will include details about the invite, such as the code, expiration, max uses, creator, etc.


---

# 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://hoppi-discord.gitbook.io/hoppi-docs/moderation/logging.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.
