Policy name that failed

Not applicable

Is there any system or flow variable is available to find last policy failed in proxy? I need to log policy name that failed. We have fault.name but it won't tell the policy name.

Solved Solved
2 7 711
1 ACCEPTED SOLUTION

@Sujnana Rai

You can use the header 'X-Apigee.fault-policy', which will get populated with the policy name if there's any error in the policy

View solution in original post

7 REPLIES 7

Hi

Check if this helps

messagelogging.{policy-name}.failedScope begins: Proxy request
Type: Boolean
Permission: Read

Failure flag for the referenced Message logging policy

Thanks,

In this method we need to check each and every policy whether it failed or not. I need generic approach withou checking individual policies. It better if we get policy name in flow variable.

@Sujnana Rai

You can use the header 'X-Apigee.fault-policy', which will get populated with the policy name if there's any error in the policy

This is working in public cloud. Howevr, not working in private cloud. I think the variable X-Apigee.fault-policy' is available in latest version Apigee. We are using 4.16.05.02.

We recently upgraded to 4.51 from 4.19. Previously it was working now it has stopped. Checking was it replaced in the new release.

Maybe just check fault.name and fault.cause

@ask4saif 

see similar query here

X-Apigee-fault-policy-not-working-in-APIGEE-version-4-51 

I quote the answer, that is - see the 4.51 release notes

https://docs.apigee.com/release/notes/45100-edge-private-cloud-release-notes 
Due to the fix for issue 132443137 (as described in the 19.03.01 Public Cloud release notes), Message Processors now ignore headers that begin with X-Apigee-*. As a result, you must refactor any code that uses X-Apigee-* headers and replace those headers with supported ones.