Solved! Go to Solution.
I managed to successfully send (error) messages from Apigee to Loggly by using a ServiceCallOut instead of a MessageLogging policy.
In Loggly it looks like below and I am now able to easily filter all messages on customer, api and environment.
Above issue has been resolved in latest release, You can now post formatted messages into loggly using message logging policy instead of service callout policy. For more details , please see article by @tskumar@apigee.com here.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageLogging async="false" continueOnError="false" enabled="true" name="Log-error-details"> <DisplayName>Log error details</DisplayName> <Syslog> <Message>[mykey@41058 tag="{apiproxy.name}"] \{ "target": "{target.name}", "environment.name": "{environment.name}", "apikey": "{client_id}", "developer": "{verifyapikey.verify-api-key.DisplayName}", "requestverb": "{request.verb}", "request.path": "{request.path}", "request.querystring": "{request.querystring}", "statuscode":"{response.status.code}", "response": "{response.content}" } </Message> <Host>logs-01.loggly.com</Host> <Port>514</Port> <Protocol>UDP</Protocol> </Syslog> </MessageLogging>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <MessageLogging async="false" continueOnError="false" enabled="true" name="Log-error-details"> <DisplayName>Log error details</DisplayName> <Syslog> <Message>[mykey@41058 tag="{apiproxy.name}" tag="foo" tag="bar" tag="{organization.name}"] \{ "target": "{target.name}", "environment.name": "{environment.name}", "apikey": "{client_id}", "developer": "{verifyapikey.verify-api-key.DisplayName}", "requestverb": "{request.verb}", "request.path": "{request.path}", "request.querystring": "{request.querystring}", "statuscode":"{response.status.code}", "response": "{response.content}" } </Message> <Host>logs-01.loggly.com</Host> <Port>514</Port> <Protocol>UDP</Protocol> </Syslog> </MessageLogging>
Unfortunately it doesn't work.
The complete content within the Message element is received as body text.
It looks like the tag properties are not sent properly to Loggly.
yeah, sorry for the confusion - check Anil's answer -- looks like that is the problem
Dear @ferry.bos ,
Welcome to Apigee Community.
I can able to reproduce same issue. It's not working as expected. I believe it's an issue due to "RFC5424 compliant header" that Apigee sends to loggly.
Ideally it should be something like below,
<165>1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource= "Application" eventID="1011"]
But what we see in loggly is something like below..
<14>Fri Sep 04 09:40:26 UTC 2015Info: [mykey@41058 tag="foo" tage="bar"]
We will keep you updated if any findings regarding same.
Cheers,
Anil Sagar
FYI, @Birute Awasthi
Hi Anil,
Is there any status update on the fix for this issue? We're running into the same thing when using the MessageLogging Policy to send logs to Loggly.
Using a ServiceCallout like @ferry.bos suggested would fix the issue but we won't be able to use it in a PostClientFlow. Would appreciate any advice/update on this. Thanks!
Hi all, same here. I am also interested in an update on this issue. See thread: https://community.apigee.com/comments/15613/view.html Regards, Rob
I managed to successfully send (error) messages from Apigee to Loggly by using a ServiceCallOut instead of a MessageLogging policy.
In Loggly it looks like below and I am now able to easily filter all messages on customer, api and environment.
@ferry.bos , Thank you for posting a solution for same. Yes, Service callout is always an option to resolve above issue. But, Problem still exists with Message Logging policy. We will follow up on same and keep you posted. Thank you once again for sharing solution with community here.
We are experiencing the same issue also. Don't want to use a service callout because we want to take advantage of the PostClientFlow and service callouts aren't allowed there.
Please let us know when fixed.
@paulmartin , We have fixed this issue. It will be available in next release. we will keep you posted.
@tskumar@apigee.com , Any idea when will be the next release?
@Anil Sagar first/second week of april tentatively.
Awesome, Thank you for the quick update.
@paulmartin , Issue has been fixed. Please check article here.
Above issue has been resolved in latest release, You can now post formatted messages into loggly using message logging policy instead of service callout policy. For more details , please see article by @tskumar@apigee.com here.