API / APIGEE Gateway Interview Questions
What is the MessageLogging policy in Apigee and how is it used for audit and debugging?
The MessageLogging policy sends log messages to an external syslog endpoint or Google Cloud Logging during or after request/response processing. Unlike debug trace (which is ephemeral), MessageLogging persists request/response data to an external system for audit trails, debugging, and compliance.
<!-- MessageLogging to Google Cloud Logging --> <MessageLogging name="ML.AuditLog"> <CloudLogging> <LogName>projects/my-project/logs/apigee-api-access</LogName> <Message contentType="application/json">{ "requestId": "{request.header.x-request-id}", "verb": "{request.verb}", "path": "{request.path}", "clientId": "{verifyapikey.VerifyAPIKey.client_id}", "statusCode": "{response.status.code}", "latency": "{target.elapsed.time}", "timestamp": "{system.timestamp}" }</Message> <Labels> <Label> <Key>environment</Key> <Value>{environment.name}</Value> </Label> </Labels> </CloudLogging> </MessageLogging> <!-- Key placement tip: MessageLogging is typically placed in the PostFlow Response AND in the DefaultFaultRule to capture both successful and error responses. The policy executes ASYNCHRONOUSLY by default -- it does NOT block the response to the client. --> <!-- Alternative: syslog (for on-prem logging systems) --> <MessageLogging name="ML.Syslog"> <Syslog> <Message>{request.verb} {request.path} - {response.status.code}</Message> <Host>logs.example.com</Host> <Port>514</Port> <Protocol>UDP</Protocol> </Syslog> </MessageLogging>
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
