VMware Cloud Community
sean_gadson
Enthusiast
Enthusiast

Workflow To Get workflow logs

Hey,

In my place of work I don't have the ability to use the console to get the full workflow logs from a workflow run.  Is there a way to get the logs of a workflow token from a workflow that was run by a different user?

Reply
0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

To get logs from a token, you can use the token's logEvents property

var logs = token.logEvents;

for each (var log in logs) {

  System.log(log.shortDescription);

}

Note that this will retrieve the so called server logs. These are the log stored in the database; from scripting, you can use eg. Server.log(...) to log such server log message.

The system logs (created by eg. System.log(...) in scripting) are not stored into the database and so they cannot be retrieved via logEvents property.

Another option to access the logs would be via REST API - /GET https://{vrohost}:8281/vco/api/workflows/{workflowid}/executions/{executionid}/logs

Also, you may need to check the user permissions - non-admin user may not have permissions to view executions/logs of the other users.

Reply
0 Kudos