How can i enable or disable the logging mechanism that i have implemented for an api proxy

Hi,

my use case is :

i have implemented logging mechanism for my api proxy ( logging in to a third partu URL using service callout policy which logs both request and response payload).

this has lead poor performance of the proxy however my client wants to run the logging policy as expected.

so my requirement here is : whenever i want to switch on /Off the logging i should be able to do that.

can you please suggest how do i do that?

Thanks,

Priyanka

0 1 196
1 REPLY 1

It appears you have fallen into an antipattern by using service callout for logging [1].

Suggest you use MessageLogging policy [2] instead, where the native policy is optimized to have better performance.

[1] https://docs.apigee.com/api-platform/antipatterns/logging-thirdparty-js

[2] https://docs.apigee.com/api-platform/reference/policies/message-logging-policy