Opened 8 years ago

Closed 6 years ago

#1739 closed defect (duplicate)

Wrong log for stats-httpd 404 response

Reported by: jreed Owned by:
Priority: low Milestone:
Component: statistics Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: Core Feature Depending on Ticket:
Estimated Difficulty: 2 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description

2012-03-01 01:34:44.q ERROR [b10-stats-httpd.stats-httpd] STATHTTPD_SERVER_DATAERROR HTTP server data error: Stats module: specified arguments are incorrect: owner: Auth, name: queries
2012-03-01 02:12:19.q ERROR [b10-stats-httpd.stats-httpd] STATHTTPD_SERVER_DATAERROR HTTP server data error: Stats module: specified arguments are incorrect: owner: Auth, name: queries
2012-03-01 17:18:36.q ERROR [b10-stats-httpd.stats-httpd] STATHTTPD_SERVER_DATAERROR HTTP server data error: Stats module: specified arguments are incorrect: owner: foo, name: None

(Ignore the .q in timestamp.)

ERROR makes the admin think its needs to be analyzed. This was caused by end-user going to a wrong webpage URI. (If this is a public webserver as I assume many would choose to do, it could get much noise in logs.)

Let's log HTTP 404 requests as a WARNING? Or only as some DEBUG level?

Also the output doesn't have the <html>...</html> tags and maybe could use a <!DOCTYPE definition?

Subtickets

Change History (9)

comment:1 Changed 8 years ago by jreed

  • Summary changed from Wrong log for wrong Stats show to Wrong log for wrong stats-httpd 404 response

comment:2 Changed 8 years ago by jreed

  • Summary changed from Wrong log for wrong stats-httpd 404 response to Wrong log for stats-httpd 404 response

comment:3 Changed 8 years ago by naokikambe

Also the output doesn't have the <html>...</html> tags and maybe could use a <!DOCTYPE definition?

This html message is actually printed by the Python library "http.server". In Python 3.2.2 the html tags and the doctype definition seem to be added to the message. The following is a part of Lib/http/server.py taken from Python 3.2.2 source.

# Default error message template
DEFAULT_ERROR_MESSAGE = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
"""

comment:4 follow-up: Changed 8 years ago by naokikambe

Sorry, this is another trivial comment. "STATHTTPD_" is typo? It would be fixed to "STATSHTTPD_" for preventing the confusion?

comment:5 Changed 8 years ago by shane

  • Milestone New Tasks deleted

comment:6 Changed 8 years ago by shane

  • Milestone set to Next-Sprint-Proposed

comment:7 Changed 8 years ago by jelte

  • Estimated Difficulty changed from 0 to 2

comment:8 in reply to: ↑ 4 Changed 8 years ago by jreed

Replying to naokikambe:

Sorry, this is another trivial comment. "STATHTTPD_" is typo? It would be fixed to "STATSHTTPD_" for preventing the confusion?

I made a ticket for that: #1884.

comment:9 Changed 6 years ago by naokikambe

  • Resolution set to duplicate
  • Status changed from new to closed

404 message is already printed as debug log:

2013-09-18 18:23:34.937 DEBUG [b10-stats-httpd.stats-httpd/18274] STATSHTTPD_HTTPLOG 127.0.0.1 code 404, message Not Found
2013-09-18 18:23:34.937 DEBUG [b10-stats-httpd.stats-httpd/18274] STATSHTTPD_HTTPLOG 127.0.0.1 "GET /bind10/statistics/xml/Foo HTTP/1.0" 404 -
Note: See TracTickets for help on using tickets.