Configuring logs and exceptions - 6.5

Talend Cloud

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > Talend Cloud components
Data Quality and Preparation > Third-party systems > Talend Cloud components
Design and Development > Third-party systems > Talend Cloud components
EnrichPlatform
Talend Studio
When building Integration Actions or Jobs in the Studio, you can use the tJobLog, tJobFailure and tLogCatcher components to define log information, collect exception data and transfer it to the Studio console or to Talend Integration Cloud web application during execution. This helps you to analyze and debug the execution of Integration Action, Jobs or Flows.

Before you begin

  • The Log4j option is enabled in the project settings. For further information, see Talend Studio for Cloud Developer Guide.

Procedure

  1. .Open the Integration Action you already defined and drop the following components from the Palette into the design workspace: tLogCatcher, tJobLog (x2) and tJobFailure.
    If you have imported the Integration Cloud Demos project, you can drop a ready-to-use exception handling subjob from the Joblets node in the Repository tree view. For further information about the demo project, see Talend Studio for Cloud Developer Guide.
  2. Link the components together using the Main links.
  3. Double-click tLogCatcher component and select the Catch Java Exception check box in the component basic settings.
    If you use the Joblet from the demo project, this option is selected by default
  4. Double-click the first tJobLog component and set the following parameters in the component basic settings:
    • Select the Developer option and set the java expression of the log message in the Log message field, for example:

      "Component: " + row1.origin + "\n | Error type: " + row1.type + "\n | Error code: " + row1.code + "\n | Error message: " + row1.message.

      This logs the error messages to the Studio.

    • Select the error type from the Priority list.

  5. Double-click the second tJobLog component and set the following parameters in the component basic settings:
    • Select the User option and set the java expression of the log message in the Log message field, for example:

      row2.message.

      This logs the error messages to the web application.

    • Select the error type from the Priority list.

  6. Double-click tJobFailure and set the following parameters in the component basic settings:
    • Set Execution failed as the error type in the Error Type field.

      You can define the error type according to your needs and the value you define in this field will show in the run detail page when you run a Flow in the Could web application.

    • Set the java expression of the message in the Error Message field, for example as the following:

      row3.job + ":" + row3.origin +": " + row3.message

      You can define the error message according to your needs.

    For further information about handling logs and exceptions in the Studio, see Talend Studio for Cloud Developer Guide.