Apigee Edge Management platform has introduced a feature in cloud release “160330_01”, whereby we can log message into loggly server using MessageLogging policy in a format required by loggly server. This can be achieved with the help of a new flag “FormatMessage” introduced, which should be set to true. The documentation is avaliable here:
Here’s an example of message-logging policy:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging async="false" continueOnError="false" enabled="true" name="Message-Logging-1">
<DisplayName>Message Logging-1</DisplayName>
<Syslog>
<Message>[{loggly-token}@41058 tag="apigee-edge" tag="{apiproxy.name}"] Sample Log Message</Message>
<Host>logs-01.loggly.com</Host>
<Port>514</Port>
<FormatMessage>true</FormatMessage>
</Syslog>
</MessageLogging>
In above example, we have to set “loggly-token” value to unique loggly account token for each loggly account. After sending message, we will notice that apigee message has been tagged under “apiproxy” name and “apigee-edge” in loggly UI. With this feature change, we no longer prefix “loggly” tokens in raw message of loggly. Attaching the loggly UI screenshot.
Sample bundle has been attached. loggly-sample.zip
