This tutorial is part of the Talend Data Integration Cloud series, and it will demonstrate how to enhance the log results displayed within Talend Cloud for an executed Job.
We have the ability to provide better logging within Talend Cloud with specific actions and components from within the studio. When I imported the cloud integration demo projects, I also received what’s called a Joblet. These are reusable integration actions that can be included in any Job, including Jobs published to the cloud.
In this example, my Joblet triggers advanced logging to display within the cloud once my Job is executed. Within this Joblet, there are various components working together.
The first is the Catch Error component, which catches any error any time within my Job once it’s ran. Then it passes it to a tActionLog component called a DeveloperLog. Here, I can specify where and how I want the logs to display the errors within the developer view. As you can see, this view is highly complex and includes incredible detail.
My next component deals with the general UserLog displaying errors as a simple message, more suitable for an average user.
Finally, in case the error within the Job didn’t actually trigger the failure of the Job execution, this flow uses the tActionFailure component. This is set to show a hard failure within the cloud following execution.
Enhancing log displays
I can use all of these components as a unified Joblet or I can implement a single component within the flow itself to affect my logging displays in specified ways.
For instance, I can add another line within my log to list the number of records written to my file. To do that, I’ll add a tActionLog component and connect it to my DropboxPut. I’ll set it to trigger On Component Ok. I want User selected here as I want all general users to see this line within their logs. I’ll enter “records written to file” and then I’ll drag and drop the number of lines code path. We’ll see that line within my log in the cloud after we republish.
Now, let’s head to the cloud. Here is my Job’s previous log. Before we’ve re-executed it within the cloud with the Joblet and additional tActionLog component implemented, I originally just had single line general messages displaying no errors.
But let’s execute our Job again and see how it affects our logs. Now, we have user level logs displaying our number of lines and comments regarding our successful execution.
Let’s execute this Job one last time with an error. Let’s switch this slash to be going the wrong way and see how this log changes. Now, a failed message displays. Let’s head to the log. My developer logs show much more detailed information about my error informing me of what I need to do to fix it.
Navigate through this tutorial series to learn more on getting started with Talend Cloud. Next, we’ll look at the Talend Management Console in the cloud. Make sure to download Talend Data Integration for free to follow along.