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

# Container Logs

Logs container item openings like Card Albums and Gift Boxes to Discord

The Container Log feature tracks when players open special containers like Card Albums, Gift Boxes, and similar items. This is perfect for celebrating rare finds or monitoring item distribution on your server.

## Action

`container_log`

## When It's Used

This log is triggered when a player opens:

* **Old Card Album** - Random card reward
* **Old Blue Box** - Random equipment
* **Old Purple Box** - Random valuable item
* **Gift Box** - Random item
* **Any custom container** you've configured

## Why Use It

* **Celebrate rare drops** when someone pulls a great card
* **Track item distribution** to understand your server's economy
* **Monitor for suspicious activity** like mass-opening containers
* **Create excitement** in your community Discord

## Server Configuration

In `conf/channels.conf`:

```
// Container opening logging
ragnasync_container_log_enabled: true
ragnasync_container_log_channel_id: "YOUR_CHANNEL_ID"
ragnasync_container_log_types: "card_album,giftbox"
ragnasync_container_log_group_min: 0
ragnasync_container_log_group_max: 0
```

| Setting      | Description                           | Default |
| ------------ | ------------------------------------- | ------- |
| `enabled`    | Enable/disable container logging      | `false` |
| `channel_id` | Discord channel ID for container logs | -       |
| `types`      | Container types to log — see below    | `all`   |
| `group_min`  | Minimum GM group level to log         | `0`     |
| `group_max`  | Maximum GM group level to log         | `99`    |

**Tip:** Set `group_min: 0` and `group_max: 0` to only log regular players (exclude GMs).

### Valid `types` values

Comma-separated, case-insensitive.

| Token        | Filters openings of                            |
| ------------ | ---------------------------------------------- |
| `all`        | Every container type (default)                 |
| `card_album` | Card Albums (Old Card Album, variants)         |
| `giftbox`    | Gift boxes — note: **one word, no underscore** |
| `misc_box`   | Other miscellaneous container items            |

{% hint style="warning" %}
A common typo is `"gift_box"` (with underscore) — the parser expects `"giftbox"`. Unknown tokens are rejected with a `[Warning]: Unknown container type '...'` line at map-server startup, and if every token is invalid the filter falls back to "log everything."
{% endhint %}

## Message Format

The default message format shows who opened what and what they got:

```
📦 Container Log: | PlayerName       | Old Card Album       | Thara Frog Card      x1
```

## Data Fields

| Field          | Type   | Description                                    |
| -------------- | ------ | ---------------------------------------------- |
| `player_name`  | string | Name of the character who opened the container |
| `name`         | string | Name of the container (e.g., "Old Card Album") |
| `container_id` | int    | Item ID of the container                       |
| `item_name`    | string | Name of the item received                      |
| `item_id`      | int    | Item ID of what was received                   |
| `amount`       | int    | Quantity received                              |
| `account_id`   | int    | Player's account ID                            |
| `char_id`      | int    | Player's character ID                          |
| `channel`      | string | Discord channel ID                             |

## Example Use Cases

### Celebrate Rare Finds

Send container logs to a public channel so everyone can see lucky pulls:

```
ragnasync_container_log_channel_id: "1234567890"  // #lucky-drops
```

### Track Card Album Results

Monitor what cards are being pulled from albums to ensure rates are working correctly.

### Custom Event Boxes

If you create custom event containers, players can see what rewards others are getting, building excitement.

## Custom Messages

Want to customize how these messages look? Head to the **Message Routes** page on your dashboard, set the format to **Custom Message**, and compose your own template using `{{placeholder}}` syntax.

**Example template:**

```
:gift: {{player_name}} opened a {{container_name}} and got {{item_name}} x{{amount}}!
```

**Available placeholders for this event:**

| Placeholder          | Example       |
| -------------------- | ------------- |
| `{{player_name}}`    | Marky         |
| `{{container_name}}` | Kafra Storage |
| `{{container_id}}`   | 1             |
| `{{item_name}}`      | Apple         |
| `{{item_id}}`        | 512           |
| `{{amount}}`         | 5             |

See [Message Routing](/ragnascript/message-routing.md) for more about formats, conditions, and multi-channel routing.

## Notes

* Each container opening is logged individually
* Works with any item that uses the random reward system
* Perfect for building community engagement around rare drops
