2022-07-15 22:37:32 +08:00
|
|
|
# 执行结果存日志
|
2018-09-07 16:16:05 +08:00
|
|
|
|
2023-08-14 17:19:08 +08:00
|
|
|
[`执行结果存日志`在线教程](https://arthas.aliyun.com/doc/arthas-tutorials.html?language=cn&id=save-log)
|
2020-08-07 19:56:15 +08:00
|
|
|
|
2022-07-15 22:37:32 +08:00
|
|
|
::: tip
|
|
|
|
将命令的结果完整保存在日志文件中,便于后续进行分析
|
|
|
|
:::
|
2018-09-07 16:16:05 +08:00
|
|
|
|
2022-07-15 22:37:32 +08:00
|
|
|
- 默认情况下,该功能是关闭的,如果需要开启,请执行以下命令:
|
2018-09-07 16:16:05 +08:00
|
|
|
|
2018-09-27 11:47:20 +08:00
|
|
|
```bash
|
2018-09-07 16:16:05 +08:00
|
|
|
$ options save-result true
|
|
|
|
NAME BEFORE-VALUE AFTER-VALUE
|
|
|
|
----------------------------------------
|
|
|
|
save-result false true
|
|
|
|
Affect(row-cnt:1) cost in 3 ms.
|
|
|
|
```
|
|
|
|
|
|
|
|
看到上面的输出,即表示成功开启该功能;
|
|
|
|
|
2022-07-15 22:37:32 +08:00
|
|
|
- 日志文件路径
|
2018-09-07 16:16:05 +08:00
|
|
|
|
|
|
|
结果会异步保存在:`{user.home}/logs/arthas-cache/result.log`,请定期进行清理,以免占据磁盘空间
|
|
|
|
|
2022-09-13 15:58:26 +08:00
|
|
|
## 使用 Arthas 的异步后台任务将结果存日志文件
|
2018-09-07 16:16:05 +08:00
|
|
|
|
2022-09-13 15:58:26 +08:00
|
|
|
参考:[async](async.md)
|