Forum Discussion

Chris_Miller's avatar
Chris_Miller
Icon for Altostratus rankAltostratus
Sep 01, 2010

What to collect for HTTP - 500 Errors?

I'd like to log HTTP 500 errors but am unsure of what info to log. I know I can log IP::server_addr but what can I do as far as the URI a user was trying to hit that caused the error?

when HTTP_RESPONSE {
  if { [HTTP::status] contains "500"} {
log local0. "HTTP 500 from Server [IP::server_addr] for .... } }
Just curious about what info the server is sending when it sends a 500 so I know what's loggable.

2 Replies

  • You would need to capture the uri on the inbound and save it in a variable. Here are a couple good rules in the codeshare that give you a start on what you might consider collecting:

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/FormattedLoggingForW3c.html Click Here

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/Custom_Apache_style_logging_for_Java_based_applications.html Click Here

     

     

     

     

  • Regarding what info the server is sending, I'd say it depends. For example, Apache may send a generic 500 Internal Server Error status page, while a Java container may send a full stack trace (which may or may not be useful to you). There are a lot of different ways it can pan out, so your idea is a good one Chris: pull out what data you care about and log that.

     

     

    -Matt