# Upload Logs
To enhance customer service efficiency and assist in resolving intermittent bugs and other issues, we provide you with the ability to upload logs, offering additional context for troubleshooting.
You can implement this feature by either calling an API or registering event callbacks.
# API
You can directly specify the path to the log file. The SDK will handle the upload of the corresponding log file, which can then be downloaded from the device information page in the customer service interface.
# SetUploadLogPath()
To enable log uploading, call this method and specify the absolute path to your log file.
FAIHelpForUEModule::Get().GetAIHelp()->SetUploadLogPath("absolute/path/to/your/logFile.log");
Note:
Please refer to this guide (opens new window) to set up AIHelp dashboard configuration for this feature.
Additionally, AIHelp currently supports uploading files in .log / .bytes / .txt / .zip formats only.
# Event
You can configure log upload steps in your RPA robot. AIHelp triggers the upload event automatically when executing these steps.
You can choose to subscribe for this event and handle the upload logic by your side, and then pass the results to AIHelp. We will display the content you passed in ticket notes.
FAIHelpForUEModule::Get().GetAIHelp()->RegisterAsyncEventListener(
EventType::LOG_UPLOAD,
[](const char *ignored, Acknowledge ack) {
std::async(std::launch::async, [jsonData, ack]() {
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
ack(EventType::LOG_UPLOAD, "{\"content\":\"this is your log\"}");
});
}
);
For compatibility purposes, the data passed back to AIHelp should be in JSON format. The log information should be stored under the key content
.
# Others
# API
We will upload the specified logs to customer service. The saved logs can be downloaded from the device information page in the customer service interface.
# Event
The content you return will be displayed in the customer service notes, providing additional context for troubleshooting.