diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-01-31 18:25:59 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-01-31 20:16:53 +0900 |
| commit | 2b8f53067b7c497bb8c4a90d9dcc41e2d5ca78e6 (patch) | |
| tree | 39dadbf4a26405a9de492108b0dbccb776180a7c /docs/src/en | |
| parent | 3f7021a3bd407f4133e76dab22cc68e31ffd018c (diff) | |
| download | LunaticChat-2b8f53067b7c497bb8c4a90d9dcc41e2d5ca78e6.tar.gz LunaticChat-2b8f53067b7c497bb8c4a90d9dcc41e2d5ca78e6.tar.bz2 LunaticChat-2b8f53067b7c497bb8c4a90d9dcc41e2d5ca78e6.zip | |
docs: Add channel chat log
Diffstat (limited to 'docs/src/en')
| -rw-r--r-- | docs/src/en/guide/admin/channel-chat/introduction.md (renamed from docs/src/en/guide/admin/introduction-channel-chat.md) | 24 | ||||
| -rw-r--r-- | docs/src/en/guide/admin/channel-chat/logs.md | 119 | ||||
| -rw-r--r-- | docs/src/en/guide/admin/configuration.md | 70 | ||||
| -rw-r--r-- | docs/src/en/guide/admin/management-data.md (renamed from docs/src/en/guide/admin/data-and-logs.md) | 12 | ||||
| -rw-r--r-- | docs/src/en/index.md | 3 |
5 files changed, 209 insertions, 19 deletions
diff --git a/docs/src/en/guide/admin/introduction-channel-chat.md b/docs/src/en/guide/admin/channel-chat/introduction.md index 2a81d63..e755139 100644 --- a/docs/src/en/guide/admin/introduction-channel-chat.md +++ b/docs/src/en/guide/admin/channel-chat/introduction.md @@ -1,4 +1,4 @@ -# Channel Chat Deployment Guide +# Channel Chat: Deployment Guide This guide explains how to deploy channel chat. @@ -6,7 +6,7 @@ This guide explains how to deploy channel chat. Channel chat is a feature that allows players to create channels and share chat among specific players. -For detailed features, please refer to the [Player Guide](../player/channel-chat/about.md). +For detailed features, please refer to the [Player Guide](../../player/channel-chat/about.md). ## Preparing to Deploy Channel Chat @@ -43,9 +43,21 @@ Recommended settings are as follows: ::: +## Channel Chat Logging + +::: warning Compatibility with Plugins like CoreProtect + +As of v0.7.0, LunaticChat's channel chat feature is not compatible with logging plugins like CoreProtect. + +::: + +Channel chat logging is enabled by default. + +For more details, see [Channel Chat: Logs](logs.md). + ## Channel Management -Basically, [players manage channels themselves](../player/channel-chat/moderation.md). +Basically, [players manage channels themselves](../../player/channel-chat/moderation.md). However, as a server administrator, please note the following: @@ -54,3 +66,9 @@ However, as a server administrator, please note the following: - If inappropriate channels or member behavior occurs, take appropriate action. If you want to avoid troubles related to channel management, consider restricting moderate commands such as `/lc channel ban`. + +## Plugins that Intercept Channel Chat + +Logging plugins like CoreProtect do not intercept LunaticChat's channel chat messages by default. + +However, plugins that use Paper API's `originalMessage()` to retrieve messages may intercept LunaticChat's channel chat messages. diff --git a/docs/src/en/guide/admin/channel-chat/logs.md b/docs/src/en/guide/admin/channel-chat/logs.md new file mode 100644 index 0000000..b65750b --- /dev/null +++ b/docs/src/en/guide/admin/channel-chat/logs.md @@ -0,0 +1,119 @@ +# Channel Chat: Logs <Badge type="tip" text="v0.7.0" /> + +Channel chat logs are a record of all messages and activities that occur within the chat. + +::: warning Compatibility with Plugins like CoreProtect + +As of v0.7.0, LunaticChat's channel chat feature is not compatible with logging plugins like CoreProtect. + +::: + +## Checking Channel Chat Logs + +Channel chat logs are stored in the `plugins/LunaticChat/logs/channelchat/` directory. + +Channel chat log files are saved in the following format: + +``` +{"timestamp":"2026-01-31T08:54:18.504343071Z","playerId":"ceaea267-39dd-3bac-931c-761ada671ebe","playerName":"m1sk9","channelId":"test","message":"Hello"} +``` + +## About File Size + +Each line is a complete JSON object, separated by line breaks, and the file as a whole is not a JSON array. + +```text +plugins/LunaticChat/logs/ +├── channel-messages-2026-01-17.json (5.2 MB) +├── channel-messages-2026-01-18.json (4.8 MB) +├── channel-messages-2026-01-19.json (6.1 MB) +├── channel-messages-2026-01-20.json (5.5 MB) +├── channel-messages-2026-01-21.json (7.2 MB) <- Weekend, active +├── channel-messages-2026-01-22.json (6.9 MB) +├── channel-messages-2026-01-23.json (4.3 MB) +├── channel-messages-2026-01-24.json (5.0 MB) +├── channel-messages-2026-01-25.json (5.4 MB) +├── channel-messages-2026-01-26.json (4.9 MB) +├── channel-messages-2026-01-27.json (6.2 MB) +├── channel-messages-2026-01-28.json (7.5 MB) +├── channel-messages-2026-01-29.json (5.8 MB) +├── channel-messages-2026-01-30.json (6.0 MB) +└── channel-messages-2026-01-31.json (2.1 MB) <- Today (in progress) +``` + +Total: approximately 83 MB + +With a 30-day retention setting, the January 17 file will be automatically deleted tomorrow. + +### Size per Message + +Channel chat log entries are approximately 200 bytes per line. + +Assuming 1000 messages per hour: + +```text +1000 msg/h × 24h × 220 bytes = 5,280,000 bytes ≈ 5.3 MB/day +``` + +With the default 30-day retention setting, this amounts to approximately **159 MB**. + +```text +5.3 MB × 30 days = 159 MB +``` + +## Visualization with Grafana Loki + +Due to the JSON format, using Promtail to ingest channel chat logs into Grafana Loki will parse them for easier reading. + +```text +2026-01-31 10:23:45.123 {job="lunatichat", player="Steve", channel="Global"} +Hello everyone! + +2026-01-31 10:24:12.456 {job="lunatichat", player="Alex", channel="Global"} +Hi Steve! + +2026-01-31 10:25:03.789 {job="lunatichat", player="Notch", channel="Development Team"} +Working on new features +``` + +::: tip Filtering Examples + +Examples of querying logs in Grafana Loki: + +```text +{job="lunatichat"} |= "new features" +{job="lunatichat", channel="Global"} +{job="lunatichat", player="Steve"} +``` + +::: + +## Command Line Checking Examples + +### View the latest 10 entries + +```bash +tail -n 10 plugins/LunaticChat/logs/channel-messages-2026-01-31.json | jq +``` + +### Extract messages from a specific player + +```bash +cat plugins/LunaticChat/logs/channel-messages-*.json | \ +jq 'select(.playerName=="Steve")' +``` + +### Count messages from a specific channel + +```bash +cat plugins/LunaticChat/logs/channel-messages-*.json | \ +jq 'select(.channelId=="global")' | wc -l +``` + +### Message count by date + +```bash +for file in plugins/LunaticChat/logs/channel-messages-*.json; do +echo "$file: $(wc -l < $file) messages" +done +``` diff --git a/docs/src/en/guide/admin/configuration.md b/docs/src/en/guide/admin/configuration.md index 6ce63b4..ef33ddc 100644 --- a/docs/src/en/guide/admin/configuration.md +++ b/docs/src/en/guide/admin/configuration.md @@ -54,6 +54,20 @@ features: channelChat: # If enabled, channel-based chat functionality will be activated. enabled: false + # Maximum number of channels that can be created per server. Set to 0 for unlimited. + maxChannelsPerServer: 0 + # Maximum number of members allowed in a single channel. Set to 0 for unlimited. + maxMembersPerChannel: 0 + # Maximum number of channels a single player can join. Set to 0 for unlimited. + maxMembershipPerPlayer: 0 + # Channel message logging configuration + messageLogging: + # If enabled, all channel messages will be logged to NDJSON files for analysis and archival. + enabled: true + # Number of days to retain log files. Set to 0 to keep logs indefinitely. + retentionDays: 30 + # Maximum size of a single log file in megabytes. Files exceeding this size will stop accepting new entries. + maxFileSizeMB: 100 # ---------------------------------------------- # --------- Message Format Settings -------- @@ -171,13 +185,67 @@ Specifies the timeout duration (in milliseconds) for API requests to the romaniz Specifies the number of retry attempts for failed API requests to the romanization conversion service. -### `features.channelChat.enabled` +### `features.channelChat` + +#### `enabled` - Type: `boolean` - Default: `false` Enables channel-based chat functionality. +#### `maxChannelsPerServer` + +- Type: `integer` +- Default: `0` + +Specifies the maximum number of channels that can be created per server. + +Set to `0` for unlimited. + +#### `maxMembersPerChannel` + +- Type: `integer` +- Default: `0` + +Specifies the maximum number of members that can join a single channel. + +Set to `0` for unlimited. + +#### `maxMembershipPerPlayer` + +- Type: `integer` +- Default: `0` + +Specifies the maximum number of channels a single player can join. + +Set to `0` for unlimited. + +#### `messageLogging.enabled` + +- Type: `boolean` +- Default: `true` + +Specifies whether to log channel chat messages in NDJSON format. + +#### `messageLogging.retentionDays` + +- Type: `integer` +- Default: `30` + +Specifies the number of days to retain channel chat log files. + +Set to `0` to never delete log files. + +#### `messageLogging.maxFileSizeMB` + +- Type: `integer` +- Default: `100` + +Specifies the maximum size (in megabytes) of channel chat log files. + +Log files exceeding `maxFileSizeMB` will stop accepting new entries. + ## Message Format Settings Available placeholders: diff --git a/docs/src/en/guide/admin/data-and-logs.md b/docs/src/en/guide/admin/management-data.md index e869552..ffed59d 100644 --- a/docs/src/en/guide/admin/data-and-logs.md +++ b/docs/src/en/guide/admin/management-data.md @@ -105,15 +105,3 @@ If the version does not match, LunaticChat recognizes the cache file as **old fo ```json {"version":"1","entries":{}} ``` - -## About CoreProtect - -Various chat logs in LunaticChat can also be recorded in CoreProtect without requiring an API. - -Logs for each feature can be checked with the following actions. When using the `/co lookup` command, specify the following actions: - -- Direct messages: `command` -- Global chat and channel chat: `chat` - - Japanese and romanization conversion is saved according to the player's settings. - - diff --git a/docs/src/en/index.md b/docs/src/en/index.md index c88e080..0fe8a53 100644 --- a/docs/src/en/index.md +++ b/docs/src/en/index.md @@ -32,9 +32,6 @@ features: - title: Japanese Romanization Conversion details: Automatically converts messages input in romaji to Japanese icon: 🌍 - - title: CoreProtect Support - details: LunaticChat's chat logs are compatible with CoreProtect - icon: 🗒️ - title: Channel Chat Feature (Planned) details: Create and manage chat channels, send private messages between specific players icon: ☎️ |
