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

Issue in using Single Message Logging Policy to log the data of multiple points

Hi All,

I need to do logging at 4 points.

1. Request -in : As soon as I receive the request.

2. Request-Out: Before sending the request to Backend.

3. Response-In: After the getting response from backend

4. Response-Out: Before sending the final response to client.

I am using javascript to store data in flow variables for every log point let's say (logRequestIn, logRequestOut, logResponseIn, logResponseOut). I have stringified JSON data in these variables.

In PostClientFlow I am using a Message Logging Policy to log this entire data.

<MessageLogging name="Log-Logging">

<Syslog>

<Message>{logRequestIn}{logRequestOut}{logResponseIn}{logResponseOut}</Message> <Host>localhost</Host>

<Port>6514</Port>

<Protocol>TCP</Protocol>

</Syslog>

</MessageLogging>

With above approach only last entry is getting logged in the third party server.

Is this a correct approach to log the entire data at once?

When I am trying it with 4 Message Logging policies and each logging policy having only one flow variable, I am getting entire data in the log server.

Could you please suggest how to proceed on this.

Thanks,

Vinita

0 3 249
3 REPLIES 3