How do I Log all 404s?

Not applicable

How do I log every 404 that gets generated?

I see some of the logs, but not all.

Solved Solved
0 6 274
1 ACCEPTED SOLUTION

Not applicable

Use error.status.code for errors generated from the proxy and response.status code for errors generated from the target.

Refer this http://docs.apigee.com/api-services/reference/variables-reference for more info.

View solution in original post

6 REPLIES 6

@amit , You mean analytics ? Or You mean Edge Message Logging ? Which message logging are you using ?

Above information is not enough, Can you share,

  1. What are you doing?
  2. What are you seeing?
  3. What are you expecting to see?

Please do share information like how did you attach message logging policy & which log destination (Syslog / Splunk / loggly ) are you using ?

I have created a default proxy that logs 404s.

On the other proxies that I have I look for invalid requests and raise a 404 which is handled by the default proxy.

e.g. I have proxies with path like /v1/items

If the requestor tries to access /items OR //v1/items, it doesn't reach the flow where I can trap this request and explicitly log a 404.

Is there a web-server / nginx log that I can scan for 404s? I want to log every 404 that apigee returns to the requestor.

Thanks for you help.

To be clear, the default proxy is a catchall proxy and has a base path of "/".

The logpolicy logs to a file on the MessageProcessor.

What do I need to log every 404?

Here is what I'm seeing.

For 401s and 404s, the LogPolicy logs empty value for {response.status.code}

The LogPolicy is in the PostClientFlow.

Not applicable

Use error.status.code for errors generated from the proxy and response.status code for errors generated from the target.

Refer this http://docs.apigee.com/api-services/reference/variables-reference for more info.

This worked for me. Thanks!