---
title: 一键收集HAF日志
description: "HAF一键收集日志功能，打包log_directory目录下所有日志，打包后会默认放到“/home/omm/haf-install/haf-target/logs/log_collection.tar”。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2200SPC2/accel/kunpengaccel_haf_06_0068.html
sourcePath: /source/zh/kunpengboostkithistory/2200SPC2/accel/kunpengaccel_haf_06_0068.html
indexId: 610e3bc7a59313de6b7b26234c7c3d613b8d9d5b2b11db23ddea8e777d13d83b78
---
# 一键收集HAF日志

HAF一键收集日志功能，打包log_directory目录下所有日志，打包后会默认放到“/home/omm/haf-install/haf-target/logs/log_collection.tar”。

主机节点和卸载节点库安装不支持日志收集功能。

卸载节点服务化安装的log_directory的配置在安装路径下的“etc/haf_offload.conf”文件中。如“/home/omm/haf-install/haf-target/etc/haf_offload.conf”。

卸载节点服务化安装中，日志收集命令：

/home/omm/haf-install/haf-target/tools/haf-tool collect

```
Collect successfully, the output package is /home/omm/haf-install/haf-target/logs/log_collection.tar
```

以卸载节点的SmartKit日志收集为例。

1. 选择“命令执行”，单击“添加”。
2. 编辑任务内容，单击“保存”。| 参数 | 内容 |
| --- | --- |
| 任务名称 | 日志收集 |
| 任务描述 | 一键收集打包日志 |
| 运行目录 | / |
| 执行命令 | /home/omm/haf\-install/haf\-target/tools/haf\-tool collect |


3. 选择“文件传输”，单击“添加”。
4. 编辑任务内容，单击“保存”。| 参数 | 内容 |
| --- | --- |
| 任务名称 | 收集打包日志到本地 |
| 传输方向 | 从远端主机传至本地 |
| 本地路径 | 本地安装包所在的目录 |
| 远端路径 | /home/omm/haf\-install/haf\-target/logs/log\_collection.tar |


  远端路径日志的根目录为安装时haf_target_install.conf中log_directory字段的内容，默认为“haf-target/logs”。
