August 16, 2023

Configuring logs and exceptions – Docs for ESB 6.x

Configuring logs and exceptions

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.
  • The Log4j option is enabled in the project settings. For further information,
    see
    Talend Studio for Cloud Developer
    Guide
    .
  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.

    use_case-tactionoutput_joblet.png

    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 + "
      | Error type: " + row1.type + "

      | Error code: " + row1.code + "
      | 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
    .

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x