CocoLogger

插件

· 作者 lechat

一个专为 Cocoworld 服务器设计的插件,将所有方块/告示牌操作记录到数据库中。

0 本站下载 0 关注 更新于 1 年前

最新 1.0.1 · 1.21.10 · Bukkit / Paper

一键开服(送7天)

CocoLogger

法语

向下滚动查看英文版

CocoLogger 是一款针对 Minecraft Spigot/Paper 1.21.4 服务器的先进日志记录插件。它允许追踪服务器上玩家的所有行为,并提供现代化的 Web 界面以查看和分析数据。

简介

该插件旨在满足 Minecraft 服务器监控和调查的需求。它自动记录玩家的重要操作,并提供直观的 Web 界面供用户查阅这些信息。

主要功能

完整的日志系统

  • 记录放置和破坏的方块及其精确坐标
  • 跟踪物品交互(使用、点击)
  • 完整记录告示牌内容(书写与修改)
  • 所有操作均带有精确的时间戳
  • 通过名称和 UUID 识别玩家

现代化 Web 界面

  • 带有实时统计信息的仪表板
  • 基于 JWT 的安全认证系统
  • 支持按玩家、操作类型、时间段进行高级筛选
  • 日志全文搜索
  • 显示物品纹理和玩家头颅皮肤
  • 响应式设计,适配移动端和桌面端
  • 智能分页,适用于海量数据

灵活的数据库支持

  • 默认内置 H2 数据库(无需配置)
  • 可选 MySQL 支持,具备自动故障转移功能
  • 通过批量处理优化性能
  • 可配置的自动备份

安装

前置要求

  • Spigot 或 Paper 服务器版本 1.21.4
  • Java 17 或更高版本

安装步骤

  1. 从 target/ 目录下载 CocoLogger.jar 文件
  2. 将文件放入服务器的 plugins/ 文件夹中
  3. 启动或重启服务器
  4. 插件将在 plugins/CocoLogger/ 中自动生成其配置文件

首次启动时,CocoLogger 会自动生成:

  • 配置文件 config.yml
  • 本地 H2 数据库
  • 运行所需的必要文件夹

配置

基础配置

config.yml 文件包含所有配置选项:

# 数据库配置
database:
  type: "H2"  # H2 或 MYSQL
  h2:
    file: "plugins/CocoLogger/database.db"
  mysql:
    host: "localhost"
    port: 3306
    database: "cocologger"
    username: "root"
    password: "password"
    useSSL: false

# Web 界面
web:
  port: 8767
  auth:
    username: "admin"
    password: "ChangeMoi123!"
    jwt_secret: "CocoLogger_Secret_Key_Change_Me_In_Production"
    jwt_expiry_hours: 24

日志记录配置

您可以启用或禁用每种类型的日志记录:

logging:
  blocks:
    enabled: true
    place: true      # 放置方块
    break: true      # 破坏方块
  items:
    enabled: true
    use: true        # 使用物品
    interact: true   # 交互
    left_click: false
    right_click: false
  signs:
    enabled: true
    write: true      # 在告示牌上书写
    edit: true       # 修改告示牌

性能优化

performance:
  batch_size: 100              # 插入操作的批次大小
  save_interval: 30            # 保存间隔(秒)
  max_memory_entries: 1000     # 内存中最大条目数

使用方法

可用命令

所有命令均需权限 cocologger.admin:

  • /cocologger reload - 重载配置
  • /cocologger status - 显示插件状态
  • /cocologger web - 显示 Web 界面信息
  • /clog 或 /cl - 命令别名

权限

权限 描述 默认设置
cocologger.admin 管理员命令访问权限 操作员 (OP)
cocologger.exempt 豁免日志记录 无

Web 界面

Web 界面可通过地址 http://服务器IP:8767 访问

默认登录信息:

  • 用户名:admin
  • 密码:ChangeMoi123!

界面功能:

  • 全局概览统计
  • 按玩家、操作类型、时间段筛选
  • 全字段文本搜索
  • 显示坐标和世界信息
  • 支持分页浏览海量数据

数据库

H2 模式(默认)

H2 模式无需任何配置。数据库会自动创建在插件文件夹内。此模式适用于大多数服务器。

MySQL 模式

要使用 MySQL,请修改配置:

database:
  type: "MYSQL"
  mysql:
    host: "your-mysql-server"
    port: 3306
    database: "cocologger"
    username: "your-user"
    password: "your-password"

插件将自动创建必要的表。如果 MySQL 连接失败,它将自动回退到 H2 模式。

故障排除

插件未启动

  1. 检查是否使用 Java 17 或更高版本
  2. 确保使用的是 Spigot/Paper 1.21.4
  3. 查看服务器日志以获取详细错误信息
  4. 检查 plugins 文件夹的权限

Web 界面无法访问

  1. 检查配置的端口(默认为 8767)是否被占用
  2. 检查服务器的防火墙规则
  3. 使用 http://localhost:8767 测试本地访问
  4. 查看插件日志以排查 Web 启动错误

数据库问题

  1. 在 H2 模式下,检查插件文件夹的写入权限
  2. 在 MySQL 模式下,使用配置参数测试连接
  3. 如果 MySQL 失败,插件会自动切换至 H2
  4. 查看日志以获取连接错误的详细信息

性能

如果发现卡顿:

  1. 增加配置中的 batch_size 值
  2. 减小 save_interval 以实现更频繁的备份
  3. 禁用次要操作(左键/右键点击)的日志记录
  4. 使用 MySQL 以获得处理大数据量时的更佳性能

安全

重要建议

  1. 立即更改 Web 界面的默认密码
  2. 修改 jwt_secret JWT 密钥用于生产环境
  3. 限制访问 通过防火墙限制对 Web 界面端口的访问
  4. 使用 HTTPS 配合反向代理以进行外部访问
  5. 定期备份 数据库

安全配置

web:
  auth:
    username: "admin"
    password: "MotDePasseComplexe123!"
    jwt_secret: "CleSecreteTresLongueEtComplexePourProduction"
    jwt_expiry_hours: 8  # 缩短有效期

版本历史

版本 1.0.0

  • 针对方块、物品和告示牌的完整日志系统
  • 带有 JWT 身份验证的 Web 界面
  • 支持 H2 和 MySQL 数据库
  • 实时统计仪表盘
  • 完整的 REST API
  • 高级过滤器与搜索功能
  • Minecraft 纹理显示
  • 灵活配置与性能优化

支持

请在 Discord 上联系我!我会尽快回复。


CocoLogger by Lechat_ (@lechat_v2 on discord for any requests)

English

CocoLogger is an advanced logging plugin for Minecraft Spigot/Paper 1.21.4 servers. It allows tracking all player actions on the server with a modern web interface for viewing and analyzing data.

Introduction

This plugin was developed to meet the needs of monitoring and investigation on Minecraft servers. It automatically records all important player actions and provides an intuitive web interface to view this information.

Main Features

Complete logging system

  • Recording of placed and broken blocks with exact coordinates
  • Tracking of item interactions (use, clicks)
  • Logging of signs with full content (writing and modifications)
  • Precise timestamp for all actions
  • Player identification by name and UUID

Modern web interface

  • Dashboard with real-time statistics
  • Secure authentication system with JWT
  • Advanced filters by player, action type, period
  • Free search in logs
  • Display of item textures and player heads
  • Responsive design for mobile and desktop
  • Smart pagination for large data volumes

Flexible database

  • Integrated H2 database by default (no configuration required)
  • Optional MySQL support with automatic failover
  • Performance optimizations with batch processing
  • Automatic backup configurable

Installation

Prerequisites

  • Spigot or Paper server version 1.21.4
  • Java 17 or higher

Installation Steps

  1. Download the CocoLogger.jar file from the target/ folder
  2. Place the file in the plugins/ folder of your server
  3. Start or restart your server
  4. The plugin will automatically create its configuration in plugins/CocoLogger/

On first launch, CocoLogger automatically generates:

  • The configuration file config.yml
  • The local H2 database
  • Necessary folders for operation

Configuration

Basic Configuration

The config.yml file contains all configuration options:

# Database configuration
database:
  type: "H2"  # H2 or MYSQL
  h2:
    file: "plugins/CocoLogger/database.db"
  mysql:
    host: "localhost"
    port: 3306
    database: "cocologger"
    username: "root"
    password: "password"
    useSSL: false

# Web interface
web:
  port: 8767
  auth:
    username: "admin"
    password: "ChangeMoi123!"
    jwt_secret: "CocoLogger_Secret_Key_Change_Me_In_Production"
    jwt_expiry_hours: 24

Logging Configuration

You can enable or disable each type of logging:

logging:
  blocks:
    enabled: true
    place: true      # Blocks placed
    break: true      # Blocks broken
  items:
    enabled: true
    use: true        # Item use
    interact: true   # Interactions
    left_click: false
    right_click: false
  signs:
    enabled: true
    write: true      # Sign writing
    edit: true       # Sign editing

Performance Optimization

performance:
  batch_size: 100              # Batch size for insertion
  save_interval: 30            # Save interval (seconds)
  max_memory_entries: 1000     # Max entries in memory

Usage

Available Commands

All commands require the cocologger.admin permission:

  • /cocologger reload - Reloads the configuration
  • /cocologger status - Displays the plugin status
  • /cocologger web - Web interface information
  • /clog or /cl - Alias for commands

Permissions

Permission Description Default
cocologger.admin Access to admin commands Operators
cocologger.exempt Exemption from logging None

Web Interface

The web interface is accessible at http://ipduserveur:8767

Default login:

  • Username: admin
  • Password: ChangeMoi123!

Interface features:

  • Overview with global statistics
  • Filtering by player, action type, period
  • Text search in all fields
  • Display of coordinates and worlds
  • Pagination for large volumes

Database

H2 Mode (default)

The H2 mode requires no configuration. The database is created automatically in the plugin folder. This mode is perfect for most servers.

MySQL Mode

To use MySQL, modify the configuration:

database:
  type: "MYSQL"
  mysql:
    host: "votre-serveur-mysql"
    port: 3306
    database: "cocologger"
    username: "votre-utilisateur"
    password: "votre-mot-de-passe"

The plugin will automatically create the necessary tables. In case of MySQL connection failure, it will automatically switch to H2.

Troubleshooting

The plugin does not start

  1. 验证您是否正在使用 Java 17 或更高版本
  2. 确保您已安装 Spigot/Paper 1.21.4
  3. 查看服务器日志以获取详细的错误信息
  4. 验证 plugins 文件夹的权限

Web 界面无法访问

  1. 验证配置的端口(默认为 8767)未被占用
  2. 检查服务器的防火墙规则
  3. 使用 http://localhost:8767 测试本地访问
  4. 检查插件日志中的启动错误

数据库问题

  1. 在 H2 模式下,验证 plugins 文件夹的写入权限
  2. 在 MySQL 模式下,使用配置参数测试连接
  3. 如果 MySQL 连接失败,插件会自动切换到 H2 模式
  4. 查看日志以获取连接错误的详细信息

性能

如果您注意到卡顿:

  1. 增加配置中的 batch_size 值
  2. 缩短 save_interval 以实现更频繁的备份
  3. 禁用不太重要的日志记录操作(左键/右键点击)
  4. 对于大数据量,使用 MySQL 以获得更好的性能

安全

重要建议

  1. 立即更改 Web 界面的默认密码
  2. 修改生产环境中的 JWT 密钥 jwt_secret
  3. 限制通过防火墙对 Web 界面端口的访问
  4. 使用 HTTPS 并通过反向代理进行外部访问
  5. 定期备份数据库

安全配置

web:
  auth:
    username: "admin"
    password: "MotDePasseComplexe123!"
    jwt_secret: "CleSecreteTresLongueEtComplexePourProduction"
    jwt_expiry_hours: 8  # 缩短有效期

版本历史

Version 1.0.0

  • 完整的方块、物品和告示牌日志系统
  • 带有 JWT 认证的 Web 界面
  • 支持 H2 和 MySQL 数据库
  • 实时统计仪表板
  • 完整的 REST API
  • 高级过滤和搜索功能
  • Minecraft 纹理显示
  • 灵活的配置和性能优化

支持

在 Discord 上联系我!我会尽快回复。


CocoLogger by Lechat_ (@lechat_v2 on discord for any requests)

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源