PlainApp
API 参考

应用日志

通过 app.capabilities 判断功能支持,通过 app.access 和宿主权限判断访问授权。示例使用合成数据,调用前请替换路径、ID、输入和筛选条件。

类型定义

graphql
type Mutation {
  clearAppLogs: Boolean!
  exportAppLogs: String
}

type Query {
  appLogFilesSize: Long!
  appLogPath: String!
  appLogs(query: String!, offset: Int!, limit: Int!): [String!]!
}

scalar Long

操作

mutation

clearAppLogs

清理应用日志文件;远程调用需要开发者模式。

graphql
mutation clearAppLogs {
  clearAppLogs
}
mutation

exportAppLogs

将应用日志导出为归档文件,可用时返回路径;远程调用需要开发者模式。

graphql
mutation exportAppLogs {
  exportAppLogs
}
query

appLogFilesSize

读取应用日志文件的总字节数;远程调用需要开发者模式。

graphql
query appLogFilesSize {
  appLogFilesSize
}
query

appLogPath

读取当前应用日志路径;远程调用需要开发者模式。

graphql
query appLogPath {
  appLogPath
}
query

appLogs

分页读取或搜索应用日志行,最新记录在前;远程调用需要开发者模式。

graphql
# Log lines, newest first. A blank `query` pages the buffer directly;
# a non-blank one filters the whole buffer and then pages, so a
# search cannot be cut short by the page size.
query appLogs($query: String!, $offset: Int!, $limit: Int!) {
  appLogs(query: $query, offset: $offset, limit: $limit)
}