Brian
Brian4w ago

Return or Save the whole BuildShip Log

I have a workflow that is pretty complex which potentially increases the chances of failing somewhere. I would like to save/send the buildship logs to another server (via REST API call) in any case - if it fails and if it succeeds. Is that possible?
3 Replies
AI Support
AI Support4w ago
AI Support Bot Information
<@112676328783802368> you can react on the relevant answer (message) with a ✅ in this thread when you think it has been solved, by the bot or by a human! Anyone can react on this message with a ❌ if the GPT bot is unhelpful or hallucinating answers. Please note: Team members will review and answer the questions on best efforts basis.
AI Support
AI Support4w ago
AI Response
Yes, you can send or save BuildShip logs to another server via a REST API call regardless of whether the workflow succeeds or fails. You can utilize the Log Specific node in BuildShip, which helps capture logs for specific events within your workflow. After capturing the logs, you can then use the HTTP Request node to send the logs to another server. To achieve this, follow these steps: 1. Add the Log Specific Node: Place this node at strategic points in your workflow where you want to capture logs. !Log Specific Node 2. Add the HTTP Request Node: Place this node to send the logs to your server via a REST API call. 3. Link the Nodes: Ensure that both the success and failure paths of your workflow include these nodes so that logs are captured and sent regardless of the outcome. Example Workflow: 1. Workflow Start: - Add your workflow start node (e.g., HTTP Trigger). 2. Log Specific Node for Success and Failure: - Add the first Log Specific node for the success path. - Add the second Log Specific node for the failure path.
3. HTTP Request Node: - Configure the HTTP Request node to send captured logs to your server. Ensure to link both Log Specific nodes to this HTTP Request node. Capture and Send Logs Code Snippet:
{
"nodes":[
{
"type":"Log Specific",
"settings":{
"captureLogs":true
}
},
{
"type":"HTTP Request",
"settings":{
"url":"https://example.com/endpoint",
"method":"POST",
"headers":{
"Content-Type":"application/json"
},
"body":{
"logs":"{{log_specific_output}}"
}
}
}
],
"connections":[
{
"from":"log_specific_success",
"to":"http_request"
},
{
"from":"log_specific_failure",
"to":"http_request"
}
]
}
{
"nodes":[
{
"type":"Log Specific",
"settings":{
"captureLogs":true
}
},
{
"type":"HTTP Request",
"settings":{
"url":"https://example.com/endpoint",
"method":"POST",
"headers":{
"Content-Type":"application/json"
},
"body":{
"logs":"{{log_specific_output}}"
}
}
}
],
"connections":[
{
"from":"log_specific_success",
"to":"http_request"
},
{
"from":"log_specific_failure",
"to":"http_request"
}
]
}
This configuration ensures that logs will be captured and sent to your specified server regardless of the workflow's outcome. For detailed documentation on the Log Specific node, please visit BuildShip Log Specific Node
BuildShip AI Support
Brian
Brian4w ago
I thought about that, but this would be pretty messy since I would have to set up a logging and patching node after each node. Furthermore how can I take the log as a variable so I can send it via REST call? It's not like the log is a public variable somewhere, is it?