Logging strategies | Best practices

Hello,

We have a requirement to log the northbound request/response and southbound request/responses along with error responses if any. At the moment we've considered two approaches.

  1. Place javascript policies at preflow, conditional flow, post flows and default fault rule to capture the log parameters as context variables and set them in the message logging policy in the postclient flow(to post them at one shot).
  2. Place message logging policies at preflow, conditional flow, post flows and default fault rule so that the log will be captured and posted everytime a message logging policy is encountered.

My question is which of the above two is a better approach? Would there be a performance impact if we used too many message logging policies?

Also I could not find any article or docs relating to logging best practices, if someone can share a reference that would be really helpful.

Thank you.

Solved Solved
0 1 1,252
1 ACCEPTED SOLUTION

If you are using the Message Logging policy then option 1 is the generally accepted best practice.

Similarly if you are using JavaScript policy with fire-and-forget HTTP calls, then you can still capture data at the points mentioned, but you will need to place the JavaScript logging policy in both the PostFlow and DefaultFaultFlow.

View solution in original post

1 REPLY 1

If you are using the Message Logging policy then option 1 is the generally accepted best practice.

Similarly if you are using JavaScript policy with fire-and-forget HTTP calls, then you can still capture data at the points mentioned, but you will need to place the JavaScript logging policy in both the PostFlow and DefaultFaultFlow.