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.
- (option 1 )Place multiple 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 post client flow where I will put all those variable in a single message logging policy.
- (option 2) Place multiple message logging policies at preflow, conditional flow, post flows and force the default fault rule ?
My question is which of the above is a better approach? Would there be a performance impact if we used too many message logging policies?
- what should be done as best practice if I want to generalize this logging strategy across multiple proxies for consistency and reusability , how can this be achieved a shared flow for example ?
- what about If I want to set different log levels for error/info , how can this be done using a single message log policy placed in post client flow which does not allow javascript policies to check on the status code. also someone mentioned the conditions tag checking on status code does not also work.
Also I could not find any article or docs relating to logging best practices, if someone can share a coding sample reference that would be really helpful.