API 文档

NinZeLogs 直接集成到您的服务器面板、托管软件或任何其他平台中。此平台专为高性能自动化而构建,可通过我们的 HTTP API 轻松集成到任何现有软件中。

粘贴日志文件

POST https://api.mclogs.lemwood.icu/1/log application/x-www-form-urlencoded
字段 类型 描述
content string 原始日志文件内容字符串。最大长度为10MiB和25k行,必要时将被截断。

cURL 从 shell 上传日志文件

curl -X POST --data-urlencode 'content@path/to/latest.log' 'https://api.mclogs.lemwood.icu/1/log'

成功 application/json

{
    "success": true,
    "id": "8FlTowW",
    "url": "https://mclogs.lemwood.icu/8FlTowW",
    "raw": "https://api.mclogs.lemwood.icu/1/raw/8FlTowW"
}

错误 application/json

{
    "success": false,
    "error": "必需的 POST 参数 'content' 为空。"
}

获取原始日志文件内容

GET https://api.mclogs.lemwood.icu/1/raw/[id]
字段 类型 描述
[id] string 日志文件 ID,从粘贴端点或 URL (https://mclogs.lemwood.icu/[id]) 获取。

成功 text/plain

[18:25:33] [Server thread/INFO]: 正在启动 minecraft 服务器版本 1.16.2
[18:25:33] [Server thread/INFO]: 正在加载属性
[18:25:34] [Server thread/INFO]: 默认游戏类型:生存模式
...

错误 application/json

{
    "success": false,
    "error": "日志未找到。"
}

获取洞察信息

GET https://api.mclogs.lemwood.icu/1/insights/[id]
字段 类型 描述
[id] string 日志文件 ID,从粘贴端点或 URL (https://mclogs.lemwood.icu/[id]) 获取。

成功 application/json

{
  "id": "name/type",
  "name": "软件名称,例如 Vanilla",
  "type": "类型名称,例如 Server Log",
  "version": "版本,例如 1.12.2",
  "title": "组合标题,例如 Vanilla 1.12.2 Server Log",
  "analysis": {
    "problems": [
      {
        "message": "解释问题的消息。",
        "counter": 1,
        "entry": {
          "level": 6,
          "time": null,
          "prefix": "条目的前缀,通常包含时间和日志级别的部分。",
          "lines": [
            {
              "number": 1,
              "content": "行的完整内容。"
            }
          ]
        },
        "solutions": [
          {
            "message": "解释可能解决方案的消息。"
          }
        ]
      }
    ],
    "information": [
      {
        "message": "Label: value",
        "counter": 1,
        "label": "此信息的标签,例如 Minecraft version",
        "value": "此信息的值,例如 1.12.2",
        "entry": {
          "level": 6,
          "time": null,
          "prefix": "条目的前缀,通常包含时间和日志级别的部分。",
          "lines": [
            {
              "number": 6,
              "content": "行的完整内容。"
            }
          ]
        }
      }
    ]
  }
}

错误 application/json

{
    "success": false,
    "error": "日志未找到。"
}

分析日志而不保存

POST https://api.mclogs.lemwood.icu/1/analyse application/x-www-form-urlencoded
字段 类型 描述
content string 原始日志文件内容字符串。最大长度为10MiB和25k行,必要时将被截断。

成功 application/json

{
  "id": "name/type",
  "name": "软件名称,例如 Vanilla",
  "type": "类型名称,例如 Server Log",
  "version": "版本,例如 1.12.2",
  "title": "组合标题,例如 Vanilla 1.12.2 Server Log",
  "analysis": {
    "problems": [
      {
        "message": "解释问题的消息。",
        "counter": 1,
        "entry": {
          "level": 6,
          "time": null,
          "prefix": "条目的前缀,通常包含时间和日志级别的部分。",
          "lines": [
            {
              "number": 1,
              "content": "行的完整内容。"
            }
          ]
        },
        "solutions": [
          {
            "message": "解释可能解决方案的消息。"
          }
        ]
      }
    ],
    "information": [
      {
        "message": "Label: value",
        "counter": 1,
        "label": "此信息的标签,例如 Minecraft version",
        "value": "此信息的值,例如 1.12.2",
        "entry": {
          "level": 6,
          "time": null,
          "prefix": "条目的前缀,通常包含时间和日志级别的部分。",
          "lines": [
            {
              "number": 6,
              "content": "行的完整内容。"
            }
          ]
        }
      }
    ]
  }
}

错误 application/json

{
    "success": false,
    "error": "必需的 POST 参数 'content' 为空。"
}

检查存储限制

GET https://api.mclogs.lemwood.icu/1/limits

成功 application/json

{
  "storageTime": 7776000,
  "maxLength": 10485760,
  "maxLines": 25000
}
字段 类型 描述
storageTime integer 日志在最后一次查看后存储的持续时间(以秒为单位)。
maxLength integer 最大文件长度(字节)。超过此限制的日志将被截断至此长度。
maxLines integer 最大行数。额外的行将被删除。

注意事项

API 目前对每个 IP 地址的速率限制为每分钟 60 个请求。此设置用于确保服务的正常运行。如果您有任何需要更高限制的用例,请随时联系我们。