Apigee MessageLogging policy has limitation to use configurable parameters such as syslog server host, port etc… details. If we are not going to configure these parameters we may get into trouble while moving the proxy from one environment to other environment. To achieve the portability the approach is to have MessageLogging policy for each environment. Based on the environment in which the proxy is running the policy will be applied. Below is the sample proxy with message logging policy for each environment. The proxy definition is given below.
The test and prod environment MessageLogging policy configuration is given below.
The proxy demonstrated is available on GitHub to download and play with it.