Components
LogViewer 日志查看器
专为云原生容器集群、CI/CD 构建流水线与函数执行监控打造的终端日志流查看器,支持日志级别着色、行号、关键字过滤与自动跟随滚屏。
控制台运维日志
包含时间戳、INFO / WARN / ERROR 状态级别标记、过滤搜索与自动跟踪滚屏(Follow)。
pod-worker-ingress-7b4c8f8 lines
1 [14:22:01.102] infoStarting application server on port :8080 (release mode)
2 [14:22:01.320] infoConnecting to cluster Redis master redis-cluster-node-0.internal...
3 [14:22:01.488] infoDatabase connection pool initialized (min=5, max=50)
4 [14:22:02.012] warnHigh query latency detected on replica node 3: 420ms
5 [14:22:03.119] debugHealthcheck heartbeat probe ACK received (latency=2ms)
6 [14:22:04.550] errorUpstream gateway timed out: HTTP 504 Gateway Timeout while proxying request
7 [14:22:04.601] infoRetrying transaction with backoff multiplier (attempt 1/3)...
8 [14:22:05.120] infoTransaction recovered successfully in 519ms
<LogViewer
:logs="sampleLogs"
title="pod-worker-ingress-7b4c8f"
height="16rem"
show-line-numbers
show-timestamps
searchable
copyable
auto-scroll
/>API 参考
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
logs | string[] | LogEntry[] | [] | 日志列表,支持字符串数组或带 level、timestamp 的 LogEntry 对象数组。 |
title | string | 'Console Logs' | 顶部标题,或通过 #title 自定义插槽覆盖。 |
height | string | '20rem' | 日志视口容器高度。 |
showLineNumbers | boolean | true | 是否显示等宽排版行号。 |
showTimestamps | boolean | false | 是否显示时间戳列。 |
searchable | boolean | true | 是否展示日志关键字过滤搜索框。 |
copyable | boolean | true | 是否提供一键复制全文操作。 |
autoScroll | boolean | true | 是否启用 Follow 尾部自动滚动模式。 |
wrap | boolean | false | 是否强制换行折行显示(默认开启横向滚动)。 |