Layer7 API Management

  • 1.  Set policy fragment globally & get logging even when an error occurs

    Posted Nov 15, 2018 10:24 AM

    For each policy  we are using, we have a policy fragment that includes all the logging we want to have. We placed this policy fragment at the end of each policy. 

     

    • Is it possible to set the policy fragment globally, so that it runs automatically on every policy? It doesn't have to be a policy fragment, but I’m looking for a way to automatically get specified logging of every policy/request

     

    Because we have placed the policy fragment at the end of the policies, it doesn’t provide us with any logging if the policy doesn't make it to the end of the policy. 

     

    • It there a way to provide us with logging no matter if the policy makes it to the end of a policy?

     

     

    Thanks in advance!



  • 2.  Re: Set policy fragment globally & get logging even when an error occurs
    Best Answer

    Posted Nov 15, 2018 04:21 PM

    Unfortunately with the broad nature of this, it is a bit difficult to narrow down specific answers to your questions. But I'll attempt here with a few notes, hopefully this will help answer your questions or can help move it forward for you.

     

    • If you want something done on every policy, no matter the policy, then setting it up in a global policy is generally the recommendation. In fact, logging is even one of the examples provided for the benefit of a global policy. 
    • Of course, there are some limitations with a global policy, so make sure that is all kept in mind for your use-cases. Such limitations are referenced on the bottom of the documentation page referenced below.
    • It depends on what type of information you want logged, but make note of that with regards to which location you choose for the global policy (in terms of on receive or on completion). The types of global policy fragments that can be used when a policy fails, for example, is also referenced on the documentation page below.
    • With a global message-received or message-completed policy, they will still be executed even if a target policy fails.

     

    Ref: Global Policy Fragments - CA API Gateway - 9.4 - CA Technologies Documentation



  • 3.  Re: Set policy fragment globally & get logging even when an error occurs

    Posted Nov 20, 2018 08:05 AM

    Thanks a lot. This is very usefull!