Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Application Integration Customization

Hi, 

I need to make some customization and reusable components in me application integrations,

My first question is: Is there a way to create a custom logger where I can log custom messages into the logs. and be able to differentiate between the Error, warning, and info messages?

Second one: is there a way to create some custom reusable components like a custom error handler and custom authorization / authentication components and be able to use those custom components across different integrations?

 

Solved Solved
1 2 388
1 ACCEPTED SOLUTION

Hi Bassant,

Thank you for the awesome questions.

Yes, you can absolutely do that and you can make it a reusable component/integration which can then be leveraged with your other integration flows. In your integration flows, you should be leveraging Error Catchers [doc] at the event/trigger and tasks levels where appropriate. Once the error is caught you have the ability to extract and enrich error details (i.e set severity, etc) and then call [doc] a reusable logging integration which can then send it to Google Cloud Logging or any other logging service (see below for an example).

As an example of how you might actually implement a reusable logging integration.

joeywong_0-1724984551885.png

In the diagram above

(1) - Is an API trigger which will start this reusable logging integration flow (you can also explore Private Triggers instead of API trigger). It takes an input JSON which I predefined as my common logging payload, which contains typical information (which integration failed, what was the exception message, etc) I would like to send to logging for me to be able to query later to help with potential investigations later.

joeywong_1-1724985221612.png

Example cehExceptionPayload.

(2) We take the common logging JSON and transform it to a GCP Cloud Logging log entry request [doc] using the Data Transformer task [doc]. This is using Jsonnet, but you can use the Javascript task if you are more familiar with that language.

joeywong_3-1724986888774.png

(3) Using the Call REST Task [doc] configured with an appropriate Auth Profile for a Service Account [doc] and scope [doc].

joeywong_2-1724986668708.png

And the outcome of this is an entry in Google Cloud Logging.

joeywong_4-1724987080511.png

Let me know if you need further details.

-Joey

 

 

 

 

View solution in original post

2 REPLIES 2

Hi Bassant,

Thank you for the awesome questions.

Yes, you can absolutely do that and you can make it a reusable component/integration which can then be leveraged with your other integration flows. In your integration flows, you should be leveraging Error Catchers [doc] at the event/trigger and tasks levels where appropriate. Once the error is caught you have the ability to extract and enrich error details (i.e set severity, etc) and then call [doc] a reusable logging integration which can then send it to Google Cloud Logging or any other logging service (see below for an example).

As an example of how you might actually implement a reusable logging integration.

joeywong_0-1724984551885.png

In the diagram above

(1) - Is an API trigger which will start this reusable logging integration flow (you can also explore Private Triggers instead of API trigger). It takes an input JSON which I predefined as my common logging payload, which contains typical information (which integration failed, what was the exception message, etc) I would like to send to logging for me to be able to query later to help with potential investigations later.

joeywong_1-1724985221612.png

Example cehExceptionPayload.

(2) We take the common logging JSON and transform it to a GCP Cloud Logging log entry request [doc] using the Data Transformer task [doc]. This is using Jsonnet, but you can use the Javascript task if you are more familiar with that language.

joeywong_3-1724986888774.png

(3) Using the Call REST Task [doc] configured with an appropriate Auth Profile for a Service Account [doc] and scope [doc].

joeywong_2-1724986668708.png

And the outcome of this is an entry in Google Cloud Logging.

joeywong_4-1724987080511.png

Let me know if you need further details.

-Joey

 

 

 

 

Hi @joeywong thanks for jumping in and provided such detailed information. 

We hope this information is helpful @Bassant_Tharwat, remember that there is an option to mark this as an accepted solution which could help others to better identify this infromation. 

Top Labels in this Space